Timer: fallback to realtime if monotonic clock is not implemented
authorRémi Denis-Courmont <remi@remlab.net>
Tue, 2 Jun 2009 19:10:41 +0000 (22:10 +0300)
committerRémi Denis-Courmont <remi@remlab.net>
Tue, 2 Jun 2009 19:10:41 +0000 (22:10 +0300)
src/misc/pthread.c

index f3127f3..be39b1b 100644 (file)
@@ -614,8 +614,13 @@ int vlc_timer_create (vlc_timer_t *id, void (*func) (vlc_timer_t *, void *),
     id->func = func;
     id->data = data;
 
+#if (_POSIX_CLOCK_SELECTION >= 0)
     if (timer_create (CLOCK_MONOTONIC, &ev, &id->handle))
+#else
+    if (timer_create (CLOCK_REALTIME, &ev, &id->handle))
+#endif
         return errno;
+
     return 0;
 }