mirror of
https://github.com/cemu-project/Cemu.git
synced 2025-07-06 06:51:18 +12:00
Make controller button code thread-safe (#405)
* Refactor spinlock to meet Lockable requirements * Input: Refactor button code and make it thread-safe
This commit is contained in:
parent
c40466f3a8
commit
028b3f7992
28 changed files with 311 additions and 220 deletions
|
@ -129,7 +129,7 @@ FSpinlock sTimerSpinlock;
|
|||
// thread safe
|
||||
uint64 PPCTimer_getFromRDTSC()
|
||||
{
|
||||
sTimerSpinlock.acquire();
|
||||
sTimerSpinlock.lock();
|
||||
_mm_mfence();
|
||||
uint64 rdtscCurrentMeasure = __rdtsc();
|
||||
uint64 rdtscDif = rdtscCurrentMeasure - _rdtscLastMeasure;
|
||||
|
@ -165,6 +165,6 @@ uint64 PPCTimer_getFromRDTSC()
|
|||
|
||||
_tickSummary += elapsedTick;
|
||||
|
||||
sTimerSpinlock.release();
|
||||
sTimerSpinlock.unlock();
|
||||
return _tickSummary;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue