diff options
author | Alexander Larsson <alexl@redhat.com> | 2010-01-12 21:16:59 +0100 |
---|---|---|
committer | Alexander Larsson <alexl@redhat.com> | 2010-01-12 21:37:20 +0100 |
commit | 0df3ca8f9bbb624b219ecdb25d3fe8aa4a51d953 (patch) | |
tree | 326a7a19dc147da61da3448fb182f06b9f6a248b /gthread | |
parent | 74ad124cfba3278c385d177a527f19574fda9670 (diff) | |
download | glib-0df3ca8f9bbb624b219ecdb25d3fe8aa4a51d953.tar.gz |
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
Diffstat (limited to 'gthread')
-rw-r--r-- | gthread/gthread-impl.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/gthread/gthread-impl.c b/gthread/gthread-impl.c index 24eb3c48e..f0f2be05d 100644 --- a/gthread/gthread-impl.c +++ b/gthread/gthread-impl.c @@ -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; |