]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
tvh thread: fix gtimer_cond timedwait and tvh_cond_init()
authorJaroslav Kysela <perex@perex.cz>
Tue, 27 Nov 2018 18:07:15 +0000 (19:07 +0100)
committerJaroslav Kysela <perex@perex.cz>
Tue, 27 Nov 2018 18:07:15 +0000 (19:07 +0100)
src/main.c
src/tvh_thread.c

index 3a18bc6cb860662f4666fee95e45e67b7976fe06..12bcb75b41bb0e90013247386474de636e42d30a 100644 (file)
@@ -714,7 +714,7 @@ mainloop(void)
     }
 
     /* Wait */
-    tvh_cond_timedwait(&gtimer_cond, &global_lock, (intptr_t )&ts);
+    tvh_cond_timedwait_ts(&gtimer_cond, &global_lock, &ts);
     tvh_mutex_unlock(&global_lock);
   }
 }
index a92517b5d2a8c806830ba4bceca9135686dcafde..437e30ef75257b7eabee3eb5bdfd0cb64d471d7a 100644 (file)
@@ -255,10 +255,12 @@ tvh_cond_init
    */
   r = 0;
 #else
-  r = pthread_condattr_setclock(&attr, CLOCK_MONOTONIC);
-  if (r) {
-    fprintf(stderr, "Unable to set monotonic clocks for conditions! (%d)", r);
-    abort();
+  if (monotonic) {
+    r = pthread_condattr_setclock(&attr, CLOCK_MONOTONIC);
+    if (r) {
+      fprintf(stderr, "Unable to set monotonic clocks for conditions! (%d)", r);
+      abort();
+    }
   }
 #endif
   return pthread_cond_init(&cond->cond, &attr);