Update release

This commit is contained in:
vczh
2023-04-30 02:21:30 -07:00
parent 878bab1564
commit 422305a3fa
17 changed files with 1407 additions and 1264 deletions
-49
View File
@@ -1710,55 +1710,6 @@ ConditionVariable
WakeAllConditionVariable(&internalData->variable);
}
/***********************************************************************
SpinLock
***********************************************************************/
SpinLock::Scope::Scope(SpinLock& _spinLock)
:spinLock(&_spinLock)
{
spinLock->Enter();
}
SpinLock::Scope::~Scope()
{
spinLock->Leave();
}
SpinLock::SpinLock()
:token(0)
{
}
SpinLock::~SpinLock()
{
}
bool SpinLock::TryEnter()
{
return _InterlockedExchange(&token, 1)==0;
}
void SpinLock::Enter()
{
while(_InterlockedCompareExchange(&token, 1, 0)!=0)
{
while (token != 0)
{
#ifdef VCZH_ARM
__yield();
#else
_mm_pause();
#endif
}
}
}
void SpinLock::Leave()
{
_InterlockedExchange(&token, 0);
}
/***********************************************************************
ThreadLocalStorage
***********************************************************************/