Thread priority changes

This commit is contained in:
Travis Nickles 2017-08-27 03:45:35 -05:00
parent e0daa9683f
commit c8809f37cb
2 changed files with 5 additions and 13 deletions

View File

@ -41,15 +41,9 @@ namespace DS4Windows
{
//sp.Stream = Properties.Resources.EE;
// Cause thread affinity to not be tied to main GUI thread
Thread x360Thread = new Thread(() => { x360Bus = new X360Device(); });
x360Thread.IsBackground = true;
x360Thread.Priority = ThreadPriority.Normal;
x360Thread.Name = "SCP Virtual Bus Thread";
x360Thread.Start();
while (!x360Thread.ThreadState.HasFlag(ThreadState.Stopped))
{
Thread.SpinWait(500);
}
Task.Run(() => {
Thread.CurrentThread.Priority = ThreadPriority.AboveNormal;
x360Bus = new X360Device(); }).Wait();
AddtoDS4List();
@ -209,7 +203,6 @@ namespace DS4Windows
}
runHotPlug = true;
return true;
}

View File

@ -148,9 +148,7 @@ namespace DS4Windows
new SaveWhere(false).ShowDialog();
}
Thread AppCollectionThread = new Thread(() => CheckDrivers());
AppCollectionThread.IsBackground = true;
AppCollectionThread.Start();
TaskRunner.Run(() => CheckDrivers());
if (string.IsNullOrEmpty(appdatapath))
{
@ -949,6 +947,7 @@ namespace DS4Windows
var uiContext = SynchronizationContext.Current;
TaskRunner.Run(() =>
{
//Thread.CurrentThread.Priority = ThreadPriority.AboveNormal;
Program.rootHub.Start(uiContext, log);
this.Invoke((System.Action)(() => { serviceStartupFinish(); }));
});