[glib] Make thread calls unconditional if G_THREADS_MANDATORY is set



commit de5c708e0b3d257388d3a5d09c80806d27069c88
Author: Alexander Larsson <alexl redhat com>
Date:   Tue Jan 12 21:26:52 2010 +0100

    Make thread calls unconditional if G_THREADS_MANDATORY is set
    
    Since gobject now initialized threads unconditionally if threads are
    available it makes no sense to have each thread operation
    conditionally check if threads are enables, so allow this to be avoided.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=606775

 glib/gthread.h |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
---
diff --git a/glib/gthread.h b/glib/gthread.h
index 019d0db..7a0abba 100644
--- a/glib/gthread.h
+++ b/glib/gthread.h
@@ -198,7 +198,11 @@ GMutex* g_static_mutex_get_mutex_impl   (GMutex **mutex);
           (cond, mutex, abs_time, G_MUTEX_DEBUG_MAGIC, G_STRLOC) : TRUE)
 #endif /* G_ERRORCHECK_MUTEXES */
 
+#if defined(G_THREADS_ENABLED) && defined(G_THREADS_MANDATORY)
+#define g_thread_supported()     1
+#else
 #define g_thread_supported()    (g_threads_got_initialized)
+#endif
 #define g_mutex_new()            G_THREAD_UF (mutex_new,      ())
 #define g_cond_new()             G_THREAD_UF (cond_new,       ())
 #define g_cond_signal(cond)      G_THREAD_CF (cond_signal,    (void)0, (cond))



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]