mirror of
https://github.com/CTCaer/RetroArch.git
synced 2025-01-10 21:10:15 +00:00
MSVC 2003-equivalent function for SignalObjectAndWait
This commit is contained in:
parent
128c20a437
commit
c258c25441
11
thread.c
11
thread.c
@ -159,7 +159,12 @@ void scond_wait(scond_t *cond, slock_t *lock)
|
||||
{
|
||||
WaitForSingleObject(cond->event, 0);
|
||||
|
||||
#if MSC_VER <= 1310
|
||||
slock_unlock(lock);
|
||||
WaitForSingleObject(cond->event, INFINITE);
|
||||
#else
|
||||
SignalObjectAndWait(lock->lock, cond->event, INFINITE, FALSE);
|
||||
#endif
|
||||
|
||||
slock_lock(lock);
|
||||
}
|
||||
@ -167,8 +172,12 @@ void scond_wait(scond_t *cond, slock_t *lock)
|
||||
bool scond_wait_timeout(scond_t *cond, slock_t *lock, int64_t timeout_us)
|
||||
{
|
||||
WaitForSingleObject(cond->event, 0);
|
||||
|
||||
#if MSC_VER <= 1310
|
||||
slock_unlock(lock);
|
||||
DWORD res = WaitForSingleObject(cond->event, (DWORD)(timeout_us) / 1000);
|
||||
#else
|
||||
DWORD res = SignalObjectAndWait(lock->lock, cond->event, (DWORD)(timeout_us) / 1000, FALSE);
|
||||
#endif
|
||||
|
||||
slock_lock(lock);
|
||||
return res == WAIT_OBJECT_0;
|
||||
|
Loading…
x
Reference in New Issue
Block a user