mirror of
https://github.com/cemu-project/DS4Windows.git
synced 2024-12-24 15:41:49 +01:00
Change thread affinity of BackgroundWorker
This commit is contained in:
parent
c8809f37cb
commit
1fedb61d2b
@ -41,9 +41,10 @@ namespace DS4Windows
|
||||
{
|
||||
//sp.Stream = Properties.Resources.EE;
|
||||
// Cause thread affinity to not be tied to main GUI thread
|
||||
Task.Run(() => {
|
||||
Thread.CurrentThread.Priority = ThreadPriority.AboveNormal;
|
||||
x360Bus = new X360Device(); }).Wait();
|
||||
Task x360task = new Task(() => { Thread.CurrentThread.Priority = ThreadPriority.AboveNormal; x360Bus = new X360Device(); });
|
||||
x360task.Start();
|
||||
while (!x360task.IsCompleted)
|
||||
Thread.SpinWait(500);
|
||||
|
||||
AddtoDS4List();
|
||||
|
||||
|
@ -919,19 +919,19 @@ namespace DS4Windows
|
||||
|
||||
protected void Form_Resize(object sender, EventArgs e)
|
||||
{
|
||||
if (FormWindowState.Minimized == this.WindowState)
|
||||
if (FormWindowState.Minimized == WindowState)
|
||||
{
|
||||
this.Hide();
|
||||
this.ShowInTaskbar = false;
|
||||
this.FormBorderStyle = FormBorderStyle.None;
|
||||
Hide();
|
||||
ShowInTaskbar = false;
|
||||
FormBorderStyle = FormBorderStyle.None;
|
||||
}
|
||||
|
||||
else if (FormWindowState.Normal == this.WindowState)
|
||||
else if (FormWindowState.Normal == WindowState)
|
||||
{
|
||||
//mAllowVisible = true;
|
||||
this.Show();
|
||||
this.ShowInTaskbar = true;
|
||||
this.FormBorderStyle = FormBorderStyle.Sizable;
|
||||
Show();
|
||||
ShowInTaskbar = true;
|
||||
FormBorderStyle = FormBorderStyle.Sizable;
|
||||
}
|
||||
|
||||
chData.AutoResize(ColumnHeaderAutoResizeStyle.HeaderSize);
|
||||
|
@ -95,7 +95,7 @@ namespace DS4Windows
|
||||
|
||||
// Create the Event handle
|
||||
threadComEvent = new EventWaitHandle(false, EventResetMode.ManualReset, SingleAppComEventName);
|
||||
CreateInterAppComThread();
|
||||
System.Threading.Tasks.Task.Run(() => { Thread.CurrentThread.Priority = ThreadPriority.Lowest; CreateInterAppComThread(); }).Wait();
|
||||
|
||||
//if (mutex.WaitOne(TimeSpan.Zero, true))
|
||||
//{
|
||||
|
Loading…
Reference in New Issue
Block a user