From 16b4963816a88e5fe025cb9e0a57b49808a4a973 Mon Sep 17 00:00:00 2001 From: Sebastian Wilhelmi Date: Fri, 15 Jun 2007 17:03:13 +0000 Subject: [PATCH] Extended the comments on those functions, that are NOOPs, before 2007-06-15 Sebastian Wilhelmi * docs/reference/glib/tmpl/threads.sgml: Extended the comments on those functions, that are NOOPs, before g_thread_init() has been called. (#447583) * glib/gthread.c (g_static_mutex_free): Clarified comment to remind myself, tha calling g_static_mutex_free() before g_thread_init() is safe. svn path=/trunk/; revision=5567 --- ChangeLog | 10 ++++++++++ docs/reference/glib/tmpl/threads.sgml | 19 +++++++++++++------ glib/gthread.c | 5 ++++- 3 files changed, 27 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index b140ead..cf2904e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2007-06-15 Sebastian Wilhelmi + + * docs/reference/glib/tmpl/threads.sgml: Extended the comments on + those functions, that are NOOPs, before g_thread_init() has been + called. (#447583) + + * glib/gthread.c (g_static_mutex_free): Clarified comment to + remind myself, tha calling g_static_mutex_free() before + g_thread_init() is safe. + 2007-06-15 Cody Russell * docs/reference/gobject/tmpl/gboxed.sgml: diff --git a/docs/reference/glib/tmpl/threads.sgml b/docs/reference/glib/tmpl/threads.sgml index 0eed7a7..4432c81 100644 --- a/docs/reference/glib/tmpl/threads.sgml +++ b/docs/reference/glib/tmpl/threads.sgml @@ -714,8 +714,11 @@ platforms. -All of the g_static_mutex_* functions can also be -used even if g_thread_init() has not yet been called. +All of the g_static_mutex_* functions apart from +g_static_mutex_get_mutex can also be used even if +g_thread_init() has not yet been called. Then they do nothing, apart +from g_static_mutex_trylock, which does nothing +but returning %TRUE. @@ -911,8 +914,10 @@ the following functions. -All of the g_static_rec_mutex_* functions can -be used even if g_thread_init() has not been called. +All of the g_static_rec_mutex_* functions can be +used even if g_thread_init() has not been called. Then they do +nothing, apart from g_static_rec_mutex_trylock, +which does nothing but returning %TRUE. @@ -969,7 +974,7 @@ functions increases the depth of @mutex and immediately returns %TRUE. -Unlocks @mutex. Another thread can will be allowed to lock @mutex only +Unlocks @mutex. Another thread will be allowed to lock @mutex only when it has been unlocked as many times as it had been locked before. If @mutex is completely unlocked and another thread is blocked in a g_static_rec_mutex_lock() call for @mutex, it will be woken and @@ -1094,7 +1099,9 @@ the following functions. All of the g_static_rw_lock_* functions can be -used even if g_thread_init() has not been called. +used even if g_thread_init() has not been called. Then they do +nothing, apart from g_static_rw_lock_*_trylock, +which does nothing but returning %TRUE. diff --git a/glib/gthread.c b/glib/gthread.c index 81df421..c47a1b3 100644 --- a/glib/gthread.c +++ b/glib/gthread.c @@ -230,7 +230,10 @@ g_static_mutex_free (GStaticMutex* mutex) g_return_if_fail (mutex); /* The runtime_mutex is the first (or only) member of GStaticMutex, - * see both versions (of glibconfig.h) in configure.in */ + * see both versions (of glibconfig.h) in configure.in. Note, that + * this variable is NULL, if g_thread_init() hasn't been called or + * if we're using the default thread implementation and it provides + * static mutexes. */ runtime_mutex = ((GMutex**)mutex); if (*runtime_mutex) -- 2.7.4