mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-08-25 02:18:55 +02:00
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:
@@ -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;
|
||||
|
||||
|
Reference in New Issue
Block a user