From: Matthias Clasen Date: Sun, 25 Sep 2011 05:51:33 +0000 (-0400) Subject: Some more gthread reshuffling X-Git-Tag: 2.31.0~336 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=cde8cf16faa14df3c688adc39f26a45aa0d88d38;p=platform%2Fupstream%2Fglib.git Some more gthread reshuffling --- diff --git a/glib/gthread.c b/glib/gthread.c index 45b5850..b57fc2b 100644 --- a/glib/gthread.c +++ b/glib/gthread.c @@ -720,6 +720,21 @@ g_thread_init_glib (void) _g_messages_thread_init_nomessage (); } +/** + * g_thread_get_initialized: + * + * Indicates if g_thread_init() has been called. + * + * Returns: %TRUE if threads have been initialized. + * + * Since: 2.20 + */ +gboolean +g_thread_get_initialized (void) +{ + return g_thread_supported (); +} + /* GOnce {{{1 ------------------------------------------------------------- */ /** @@ -1166,7 +1181,7 @@ g_static_private_free (GStaticPrivate *private_key) } } -/* GThread Extra Functions {{{1 ------------------------------------------- */ +/* GThread {{{1 -------------------------------------------------------- */ static void g_thread_cleanup (gpointer data) @@ -1442,11 +1457,12 @@ g_thread_self (void) if (!thread) { - /* If no thread data is available, provide and set one. This - can happen for the main thread and for threads, that are not - created by GLib. */ + /* If no thread data is available, provide and set one. + * This can happen for the main thread and for threads + * that are not created by GLib. + */ thread = g_new0 (GRealThread, 1); - thread->thread.joinable = FALSE; /* This is a save guess */ + thread->thread.joinable = FALSE; /* This is a safe guess */ thread->thread.func = NULL; thread->thread.data = NULL; thread->private_data = NULL; @@ -1464,8 +1480,6 @@ g_thread_self (void) return (GThread*)thread; } - /* Unsorted {{{1 ---------------------------------------------------------- */ - /** * g_thread_foreach: * @thread_func: function to call for all #GThread structures @@ -1512,20 +1526,7 @@ g_thread_foreach (GFunc thread_func, } } -/** - * g_thread_get_initialized: - * - * Indicates if g_thread_init() has been called. - * - * Returns: %TRUE if threads have been initialized. - * - * Since: 2.20 - */ -gboolean -g_thread_get_initialized (void) -{ - return g_thread_supported (); -} +/* GMutex {{{1 ------------------------------------------------------ */ /** * g_mutex_new: @@ -1561,6 +1562,8 @@ g_mutex_free (GMutex *mutex) g_slice_free (GMutex, mutex); } +/* GCond {{{1 ------------------------------------------------------ */ + /** * g_cond_new: * @@ -1592,6 +1595,8 @@ g_cond_free (GCond *cond) g_slice_free (GCond, cond); } +/* GPrivate {{{1 ------------------------------------------------------ */ + /** * g_private_new: * @destructor: a function to destroy the data keyed to @@ -1629,4 +1634,4 @@ g_private_new (GDestroyNotify notify) return key; } -/* vim: set foldmethod=marker: */ + /* vim: set foldmethod=marker: */