+2007-06-15 Sebastian Wilhelmi <wilhelmi@google.com>
+
+ * 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 <bratsche@gnome.org>
* docs/reference/gobject/tmpl/gboxed.sgml:
</para>
<para>
-All of the <function>g_static_mutex_*</function> functions can also be
-used even if g_thread_init() has not yet been called.
+All of the <function>g_static_mutex_*</function> functions apart from
+<function>g_static_mutex_get_mutex</function> can also be used even if
+g_thread_init() has not yet been called. Then they do nothing, apart
+from <function>g_static_mutex_trylock</function>, which does nothing
+but returning %TRUE.
</para>
<note>
</para>
<para>
-All of the <function>g_static_rec_mutex_*</function> functions can
-be used even if g_thread_init() has not been called.
+All of the <function>g_static_rec_mutex_*</function> functions can be
+used even if g_thread_init() has not been called. Then they do
+nothing, apart from <function>g_static_rec_mutex_trylock</function>,
+which does nothing but returning %TRUE.
</para>
<!-- ##### FUNCTION g_static_rec_mutex_unlock ##### -->
<para>
-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
<para>
All of the <function>g_static_rw_lock_*</function> 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 <function>g_static_rw_lock_*_trylock</function>,
+which does nothing but returning %TRUE.
</para>
<note>
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)