Bug 560676 - function access for g_threads_supported
authorMike Kestner <mkestner@novell.com>
Thu, 18 Dec 2008 19:20:42 +0000 (19:20 +0000)
committerMike Kestner <mkestner@src.gnome.org>
Thu, 18 Dec 2008 19:20:42 +0000 (19:20 +0000)
2008-12-18  Mike Kestner <mkestner@novell.com>

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
glib/gthread.c
glib/gthread.h

index eec5167e2e2f34dc237d7eeebf885cfd0f1ec17a..462d69ccaa26a17059c4900917c1150870772eb0 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2008-12-18  Mike Kestner <mkestner@novell.com>
+
+       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 <mclasen@redhat.com>
 
        * configure.in: Bump version
index e186b9f23741f106d28b72a010d28613b7c52e49..45c169f429d8ed631921872b58b137f4208f801d 100644 (file)
@@ -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"
index af1e301ebced96198ce1d37a72efd7464018f8e0..8b8f7cdd184e633206aaf47166645e654e7441ef 100644 (file)
@@ -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