1
0
mirror of https://github.com/libretro/RetroArch synced 2025-04-03 19:20:24 +00:00

MSVC 2003-equivalent function for SignalObjectAndWait

This commit is contained in:
twinaphex 2014-06-25 04:06:42 +02:00
parent 128c20a437
commit c258c25441

@ -159,7 +159,12 @@ void scond_wait(scond_t *cond, slock_t *lock)
{ {
WaitForSingleObject(cond->event, 0); WaitForSingleObject(cond->event, 0);
#if MSC_VER <= 1310
slock_unlock(lock);
WaitForSingleObject(cond->event, INFINITE);
#else
SignalObjectAndWait(lock->lock, cond->event, INFINITE, FALSE); SignalObjectAndWait(lock->lock, cond->event, INFINITE, FALSE);
#endif
slock_lock(lock); 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) bool scond_wait_timeout(scond_t *cond, slock_t *lock, int64_t timeout_us)
{ {
WaitForSingleObject(cond->event, 0); 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); DWORD res = SignalObjectAndWait(lock->lock, cond->event, (DWORD)(timeout_us) / 1000, FALSE);
#endif
slock_lock(lock); slock_lock(lock);
return res == WAIT_OBJECT_0; return res == WAIT_OBJECT_0;