mirror of
https://github.com/cemu-project/DS4Windows.git
synced 2024-11-26 11:04:21 +01:00
Added flag to allow skipping a lock when applicable
This commit is contained in:
parent
ce78793dea
commit
32605524ff
@ -398,6 +398,7 @@ namespace DS4Windows
|
|||||||
private bool timeoutExecuted = false;
|
private bool timeoutExecuted = false;
|
||||||
private bool timeoutEvent = false;
|
private bool timeoutEvent = false;
|
||||||
private bool runCalib;
|
private bool runCalib;
|
||||||
|
private bool hasInputEvts = false;
|
||||||
public bool ShouldRunCalib()
|
public bool ShouldRunCalib()
|
||||||
{
|
{
|
||||||
return runCalib;
|
return runCalib;
|
||||||
@ -1090,13 +1091,18 @@ namespace DS4Windows
|
|||||||
|
|
||||||
cState.CopyTo(pState);
|
cState.CopyTo(pState);
|
||||||
|
|
||||||
lock (eventQueueLock)
|
if (hasInputEvts)
|
||||||
{
|
{
|
||||||
Action tempAct = null;
|
lock (eventQueueLock)
|
||||||
for (int actInd = 0, actLen = eventQueue.Count; actInd < actLen; actInd++)
|
|
||||||
{
|
{
|
||||||
tempAct = eventQueue.Dequeue();
|
Action tempAct = null;
|
||||||
tempAct.Invoke();
|
for (int actInd = 0, actLen = eventQueue.Count; actInd < actLen; actInd++)
|
||||||
|
{
|
||||||
|
tempAct = eventQueue.Dequeue();
|
||||||
|
tempAct.Invoke();
|
||||||
|
}
|
||||||
|
|
||||||
|
hasInputEvts = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1467,6 +1473,7 @@ namespace DS4Windows
|
|||||||
lock (eventQueueLock)
|
lock (eventQueueLock)
|
||||||
{
|
{
|
||||||
eventQueue.Enqueue(act);
|
eventQueue.Enqueue(act);
|
||||||
|
hasInputEvts = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user