diff options
author | Matthias Clasen <mclasen@redhat.com> | 2007-01-08 12:59:05 +0000 |
---|---|---|
committer | Matthias Clasen <matthiasc@src.gnome.org> | 2007-01-08 12:59:05 +0000 |
commit | cf7dcc4f38de65245382764daed6cb79f9be053a (patch) | |
tree | d22229e2b63105e5339d96d092ee8bbfeb925a1a | |
parent | 06f1459ff253d15ea5d8139f7ec9563fd6e7221b (diff) |
Don't use _SC_MONOTONIC_CLOCK unless USE_CLOCK_GETTIME is defined.
2007-01-08 Matthias Clasen <mclasen@redhat.com>
* gthread/gthread-posix.c (g_thread_impl_init): Don't
use _SC_MONOTONIC_CLOCK unless USE_CLOCK_GETTIME is
defined. (#394150)
svn path=/trunk/; revision=5230
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | gthread/gthread-posix.c | 4 |
2 files changed, 9 insertions, 1 deletions
@@ -1,3 +1,9 @@ +2007-01-08 Matthias Clasen <mclasen@redhat.com> + + * gthread/gthread-posix.c (g_thread_impl_init): Don't + use _SC_MONOTONIC_CLOCK unless USE_CLOCK_GETTIME is + defined. (#394150) + 2007-01-07 Matthias Clasen <mclasen@redhat.com> Don't link glib against libpthread. (#393812) diff --git a/gthread/gthread-posix.c b/gthread/gthread-posix.c index 0d89e85d9..d05165c68 100644 --- a/gthread/gthread-posix.c +++ b/gthread/gthread-posix.c @@ -119,9 +119,9 @@ static gulong g_thread_min_stack_size = 0; #define G_MUTEX_SIZE (sizeof (pthread_mutex_t)) -static gint posix_clock = 0; #if defined(HAVE_CLOCK_GETTIME) && defined(HAVE_MONOTONIC_CLOCK) #define USE_CLOCK_GETTIME 1 +static gint posix_clock = 0; #endif #if defined(_SC_THREAD_STACK_MIN) || defined (HAVE_PRIORITIES) || defined (USE_CLOCK_GETTIME) @@ -147,10 +147,12 @@ g_thread_impl_init(void) # endif #endif /* HAVE_PRIORITIES */ +#ifdef USE_CLOCK_GETTIME if (sysconf (_SC_MONOTONIC_CLOCK) >= 0) posix_clock = CLOCK_MONOTONIC; else posix_clock = CLOCK_REALTIME; +#endif } #endif /* _SC_THREAD_STACK_MIN || HAVE_PRIORITIES */ |