mirror of
https://github.com/cemu-project/DS4Windows.git
synced 2025-01-11 15:59:08 +01:00
Change some thread priorities
This commit is contained in:
parent
08be7f1060
commit
d6d6f63073
@ -43,7 +43,7 @@ namespace DS4Windows
|
||||
// Cause thread affinity to not be tied to main GUI thread
|
||||
Thread x360Thread = new Thread(() => { x360Bus = new X360Device(); });
|
||||
x360Thread.IsBackground = true;
|
||||
x360Thread.Priority = ThreadPriority.AboveNormal;
|
||||
x360Thread.Priority = ThreadPriority.Normal;
|
||||
x360Thread.Name = "SCP Virtual Bus Thread";
|
||||
x360Thread.Start();
|
||||
while (!x360Thread.ThreadState.HasFlag(ThreadState.Stopped))
|
||||
|
@ -72,6 +72,7 @@ namespace DS4Windows
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
System.Runtime.GCSettings.LatencyMode = System.Runtime.GCLatencyMode.LowLatency;
|
||||
|
||||
try
|
||||
@ -126,6 +127,7 @@ namespace DS4Windows
|
||||
{
|
||||
BackgroundWorker worker = sender as BackgroundWorker;
|
||||
WaitHandle[] waitHandles = new WaitHandle[] { threadComEvent };
|
||||
Thread.CurrentThread.Priority = ThreadPriority.Lowest;
|
||||
|
||||
while (!worker.CancellationPending)
|
||||
{
|
||||
@ -144,7 +146,6 @@ namespace DS4Windows
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// When this method is called using a Invoke then this runs in the thread
|
||||
/// that created the form, which is nice.
|
||||
@ -169,6 +170,7 @@ namespace DS4Windows
|
||||
SetForegroundWindow(wp.form.Handle);
|
||||
}
|
||||
}
|
||||
|
||||
SetForegroundWindow(frm.Handle);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user