Utilities: Add TryWait and spin waits to semaphore and mutex

This commit is contained in:
TellowKrinkle
2021-03-28 03:09:52 -05:00
committed by Kojin
parent 5ff89dd695
commit 881b017606
4 changed files with 47 additions and 0 deletions
+5
View File
@@ -165,6 +165,11 @@ void Threading::Semaphore::WaitNoCancel(const wxTimeSpan& timeout)
pthread_setcancelstate(oldstate, NULL);
}
bool Threading::Semaphore::TryWait()
{
return sem_trywait(&m_sema) == 0;
}
int Threading::Semaphore::Count()
{
int retval;