From 8bed68813e1af61d082642f1e69453ddecb6eeba Mon Sep 17 00:00:00 2001 From: Mike Kestner Date: Thu, 18 Dec 2008 19:20:42 +0000 Subject: [PATCH] Bug 560676 - function access for g_threads_supported 2008-12-18 Mike Kestner Bug 560676 - function access for g_threads_supported * glib/gthreads.c (g_thread_get_initialized): new accessor for g_threads_supported macro. * glib/gthreads.h: add g_thread_get_initialized svn path=/trunk/; revision=7752 --- ChangeLog | 8 ++++++++ glib/gthread.c | 13 +++++++++++++ glib/gthread.h | 5 +++++ 3 files changed, 26 insertions(+) diff --git a/ChangeLog b/ChangeLog index eec5167e2..462d69cca 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2008-12-18 Mike Kestner + + Bug 560676 - function access for g_threads_supported + + * glib/gthreads.c (g_thread_get_initialized): new accessor for + g_threads_supported macro. + * glib/gthreads.h: add g_thread_get_initialized + 2008-12-15 Matthias Clasen * configure.in: Bump version diff --git a/glib/gthread.c b/glib/gthread.c index e186b9f23..45c169f42 100644 --- a/glib/gthread.c +++ b/glib/gthread.c @@ -974,5 +974,18 @@ g_thread_foreach (GFunc thread_func, } } +/** + * g_thread_get_initialized + * + * Indicates if g_thread_init() has been called. + * + * Since: 2.20 + */ +gboolean +g_thread_get_initialized () +{ + return g_thread_supported (); +} + #define __G_THREAD_C__ #include "galiasdef.c" diff --git a/glib/gthread.h b/glib/gthread.h index af1e301eb..8b8f7cdd1 100644 --- a/glib/gthread.h +++ b/glib/gthread.h @@ -134,6 +134,11 @@ void g_thread_init (GThreadFunctions *vtable); */ void g_thread_init_with_errorcheck_mutexes (GThreadFunctions* vtable); +/* Checks if thread support is initialized. Identical to the + * g_thread_supported macro but provided for language bindings. + */ +gboolean g_thread_get_initialized (void); + /* A random number to recognize debug calls to g_mutex_... */ #define G_MUTEX_DEBUG_MAGIC 0xf8e18ad7