mirror of
https://github.com/ayufan/steam-deck-tools.git
synced 2026-04-06 23:03:59 +00:00
Make code lock-less on critical path
This commit is contained in:
parent
190b14e66f
commit
558d37e940
3 changed files with 43 additions and 50 deletions
|
|
@ -59,7 +59,7 @@ namespace SteamController
|
|||
continue;
|
||||
|
||||
var profileItem = new ToolStripMenuItem(profile.Name);
|
||||
profileItem.Click += delegate { lock (context) { context.SelectProfile(profile.Name); } };
|
||||
profileItem.Click += delegate { context.SelectProfile(profile.Name); };
|
||||
contextMenu.Opening += delegate { profileItem.Checked = context.GetCurrentProfile() == profile; };
|
||||
contextMenu.Items.Add(profileItem);
|
||||
}
|
||||
|
|
@ -149,12 +149,8 @@ namespace SteamController
|
|||
}
|
||||
|
||||
updatesReceived++;
|
||||
|
||||
lock (context)
|
||||
{
|
||||
context.Update();
|
||||
context.Debug();
|
||||
}
|
||||
context.Update();
|
||||
context.Debug();
|
||||
|
||||
if (!context.Enabled)
|
||||
{
|
||||
|
|
@ -179,11 +175,8 @@ namespace SteamController
|
|||
|
||||
private void ContextStateUpdate_Tick(object? sender, EventArgs e)
|
||||
{
|
||||
lock (context)
|
||||
{
|
||||
context.Tick();
|
||||
SharedData_Update();
|
||||
}
|
||||
context.Tick();
|
||||
SharedData_Update();
|
||||
|
||||
if (!context.Mouse.Valid)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue