From 0df3ca8f9bbb624b219ecdb25d3fe8aa4a51d953 Mon Sep 17 00:00:00 2001 From: Alexander Larsson Date: Tue, 12 Jan 2010 21:16:59 +0100 Subject: 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 --- gthread/gthread-impl.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'gthread') 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; -- cgit v1.2.1