Commit f5e9d0f6 authored by KO Myung-Hun's avatar KO Myung-Hun Committed by Rémi Denis-Courmont

os2: thread: use gettimeofday() instead of time()

Signed-off-by: default avatarRémi Denis-Courmont <remi@remlab.net>
parent f8f9b3f6
...@@ -343,9 +343,15 @@ int vlc_cond_timedwait (vlc_cond_t *p_condvar, vlc_mutex_t *p_mutex, ...@@ -343,9 +343,15 @@ int vlc_cond_timedwait (vlc_cond_t *p_condvar, vlc_mutex_t *p_mutex,
mtime_t total; mtime_t total;
switch (p_condvar->clock) switch (p_condvar->clock)
{ {
case CLOCK_REALTIME: /* FIXME? sub-second precision */ case CLOCK_REALTIME:
total = CLOCK_FREQ * time (NULL); {
struct timeval tv;
gettimeofday (&tv, NULL);
total = CLOCK_FREQ * tv.tv_sec +
CLOCK_FREQ * tv.tv_usec / 1000000L;
break; break;
}
default: default:
assert (p_condvar->clock == CLOCK_MONOTONIC); assert (p_condvar->clock == CLOCK_MONOTONIC);
total = mdate(); total = mdate();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment