mirror of
https://github.com/FEX-Emu/FEX.git
synced 2025-01-31 11:32:07 +00:00
FutexSpinWait: Implement spin-loop Unique mutex.
This commit is contained in:
parent
136fa78825
commit
2c5dd20f3c
@ -263,4 +263,18 @@ namespace FEXCore::Utils::FutexSpinWait {
|
||||
#undef SPINLOOP_16BIT
|
||||
#undef SPINLOOP_32BIT
|
||||
#undef SPINLOOP_64BIT
|
||||
template<typename T>
|
||||
class UniqueSpinMutex final {
|
||||
public:
|
||||
UniqueSpinMutex(T *Futex)
|
||||
: Futex {Futex} {
|
||||
FEXCore::Utils::FutexSpinWait::lock(Futex);
|
||||
}
|
||||
|
||||
~UniqueSpinMutex() {
|
||||
FEXCore::Utils::FutexSpinWait::unlock(Futex);
|
||||
}
|
||||
private:
|
||||
T *Futex;
|
||||
};
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user