summaryrefslogtreecommitdiffstats
path: root/osdep/win32/pthread.c
diff options
context:
space:
mode:
Diffstat (limited to 'osdep/win32/pthread.c')
-rw-r--r--osdep/win32/pthread.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/osdep/win32/pthread.c b/osdep/win32/pthread.c
index 141ecfc5e0..a178d72253 100644
--- a/osdep/win32/pthread.c
+++ b/osdep/win32/pthread.c
@@ -21,6 +21,9 @@
#include <errno.h>
#include <sys/time.h>
#include <assert.h>
+#include <windows.h>
+
+#include "osdep/timer.h" // mp_{start,end}_hires_timers
int pthread_once(pthread_once_t *once_control, void (*init_routine)(void))
{
@@ -78,11 +81,13 @@ static int cond_wait(pthread_cond_t *restrict cond,
DWORD ms)
{
BOOL res;
+ int hrt = mp_start_hires_timers(ms);
if (mutex->use_cs) {
res = SleepConditionVariableCS(cond, &mutex->lock.cs, ms);
} else {
res = SleepConditionVariableSRW(cond, &mutex->lock.srw, ms, 0);
}
+ mp_end_hires_timers(hrt);
return res ? 0 : ETIMEDOUT;
}