summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Gilbert <bgilbert@backtick.net>2014-10-09 00:07:36 -0400
committerMatthias Clasen <mclasen@redhat.com>2014-10-10 06:41:55 -0400
commit0bfea5e7728bf7bc9e25da3c828b60c6fc9c776f (patch)
tree55afded72f860370a781c3b41d776aacb2ed3dc4
parent549e7b0de62b9f31825f0c24f41cfa7eaad97360 (diff)
downloadglib-0bfea5e7728bf7bc9e25da3c828b60c6fc9c776f.tar.gz
Fix g_cond_timed_wait() timeout with !CLOCK_MONOTONIC
g_get_monotonic_time() and g_get_real_time() now always use different clocks, so we cannot avoid correcting for their offset. Fixes failure to time out on Mac OS X. https://bugzilla.gnome.org/show_bug.cgi?id=738197
-rw-r--r--glib/deprecated/gthread-deprecated.c6
1 files changed, 0 insertions, 6 deletions
diff --git a/glib/deprecated/gthread-deprecated.c b/glib/deprecated/gthread-deprecated.c
index 47a1fbb11..1dec7194a 100644
--- a/glib/deprecated/gthread-deprecated.c
+++ b/glib/deprecated/gthread-deprecated.c
@@ -1564,16 +1564,10 @@ g_cond_timed_wait (GCond *cond,
end_time *= 1000000;
end_time += abs_time->tv_usec;
-#ifdef CLOCK_MONOTONIC
/* would be nice if we had clock_rtoffset, but that didn't seem to
* make it into the kernel yet...
*/
end_time += g_get_monotonic_time () - g_get_real_time ();
-#else
- /* if CLOCK_MONOTONIC is not defined then g_get_montonic_time() and
- * g_get_real_time() are returning the same clock, so don't bother...
- */
-#endif
return g_cond_wait_until (cond, mutex, end_time);
}