GNOME Bugzilla – Bug 736651
glib doesn't build on NetBSD 5
Last modified: 2014-09-15 01:33:20 UTC
CC libglib_2_0_la-gthread-posix.lo gthread-posix.c:648:2: error: #error Cannot support GCond on your platform. Essentially, this is because of Bug 673607, which to quote Comment 8 says: With this patch, we now require that one of pthread_condattr_setclock() or pthread_cond_timedwait_relative_np() exists. which isn't implemented on NetBSD 5. (It is in NetBSD 6 and 7)
NetBSD 5 does have pthread_cond_timedwait and CLOCK_MONOTONIC.
Created attachment 286180 [details] [review] pthread_cond_timedwait() implementation of g_cond_wait_until() Since Bug 673607, g_cond_wait_until requires either pthread_condattr_setclock or pthread_cond_timedwait_relative_np. This implementation drops the requirement to pthread_cond_timedwait and CLOCK_MONOTONIC. Patch from OBATA Akio. Build failure reported and fix tested by John Klos.
Hi Patrick. Thanks for the patch. You may have noticed that this is the way that we handled this before, but we dropped it because ultimately it is an unpredictable hack. If the system clock changes while the sleep is in progress, you may end up timing out immediately or the program may stall for (seemingly) forever. Long story short is that we're not really interested in having this code back in GLib. I have no problem if you want to apply this as a patch in your own ports tree, however. Sorry :(