mirror of
https://github.com/cemu-project/DS4Windows.git
synced 2024-11-29 12:34:18 +01:00
parent
8c12fe742c
commit
26f0b1783e
@ -39,6 +39,7 @@ namespace DS4Windows
|
|||||||
public static ControlService rootHub;
|
public static ControlService rootHub;
|
||||||
private static Thread testThread;
|
private static Thread testThread;
|
||||||
private static Thread controlThread;
|
private static Thread controlThread;
|
||||||
|
private static System.Threading.Timer collectTimer;
|
||||||
private static Form ds4form;
|
private static Form ds4form;
|
||||||
|
|
||||||
private static MemoryMappedFile ipcClassNameMMF = null; // MemoryMappedFile for inter-process communication used to hold className of DS4Form window
|
private static MemoryMappedFile ipcClassNameMMF = null; // MemoryMappedFile for inter-process communication used to hold className of DS4Form window
|
||||||
@ -192,7 +193,10 @@ namespace DS4Windows
|
|||||||
|
|
||||||
private static void createControlService()
|
private static void createControlService()
|
||||||
{
|
{
|
||||||
controlThread = new Thread(() => { rootHub = new ControlService(); });
|
controlThread = new Thread(() => {
|
||||||
|
rootHub = new ControlService();
|
||||||
|
collectTimer = new System.Threading.Timer(GarbageTask, null, 30000, 30000);
|
||||||
|
});
|
||||||
controlThread.Priority = ThreadPriority.Normal;
|
controlThread.Priority = ThreadPriority.Normal;
|
||||||
controlThread.IsBackground = true;
|
controlThread.IsBackground = true;
|
||||||
controlThread.Start();
|
controlThread.Start();
|
||||||
@ -200,6 +204,11 @@ namespace DS4Windows
|
|||||||
Thread.SpinWait(500);
|
Thread.SpinWait(500);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static void GarbageTask(object state)
|
||||||
|
{
|
||||||
|
GC.Collect(0, GCCollectionMode.Forced, false);
|
||||||
|
}
|
||||||
|
|
||||||
private static void CreateTempWorkerThread()
|
private static void CreateTempWorkerThread()
|
||||||
{
|
{
|
||||||
testThread = new Thread(SingleAppComThread_DoWork);
|
testThread = new Thread(SingleAppComThread_DoWork);
|
||||||
|
Loading…
Reference in New Issue
Block a user