Changed thread affinity of ControlService instance

Seems to help. Only tested with Gex so far using KB emulation.
Need to try some other games
This commit is contained in:
Travis Nickles 2017-09-07 22:37:56 -05:00
parent 67430aa18d
commit d7f74815e1

View File

@ -102,7 +102,8 @@ namespace DS4Windows
//if (mutex.WaitOne(TimeSpan.Zero, true)) //if (mutex.WaitOne(TimeSpan.Zero, true))
//{ //{
rootHub = new ControlService(); createControlService();
//rootHub = new ControlService();
Application.EnableVisualStyles(); Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false); Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new DS4Form(args)); Application.Run(new DS4Form(args));
@ -116,6 +117,16 @@ namespace DS4Windows
threadComEvent.Close(); threadComEvent.Close();
} }
private static void createControlService()
{
Thread temp = new Thread(() => { rootHub = new ControlService(); });
temp.Priority = ThreadPriority.Normal;
temp.IsBackground = true;
temp.Start();
while (temp.IsAlive)
Thread.SpinWait(500);
}
private static void CreateTempWorkerThread() private static void CreateTempWorkerThread()
{ {
testThread = new Thread(singleAppComThread_DoWork); testThread = new Thread(singleAppComThread_DoWork);