Relax g_thread_init() requirements

We now allow g_thread_init(NULL) to be called after other glib calls (with
some minor limitations). This is mainly a documentation change as this
really was already possible.

We also allow g_thread_init() to be called multiple times. Only the
first call actually initializes the threading system, further calls
are ignored (but print a warning if the argument is not NULL).

https://bugzilla.gnome.org/show_bug.cgi?id=606775
This commit is contained in:
Alexander Larsson
2010-01-12 21:16:59 +01:00
parent 74ad124cfb
commit 0df3ca8f9b
2 changed files with 24 additions and 36 deletions

View File

@@ -294,7 +294,12 @@ g_thread_init (GThreadFunctions* init)
gboolean supported;
if (thread_system_already_initialized)
g_error ("GThread system may only be initialized once.");
{
if (init != NULL)
g_warning ("GThread system already initialized, ignoring custom thread implementation.");
return;
}
thread_system_already_initialized = TRUE;