From 6c0dda8265a547d89b4c546298d0a29519f68749 Mon Sep 17 00:00:00 2001 From: Ryan Lortie Date: Wed, 31 Aug 2011 18:07:55 -0400 Subject: [PATCH] make g_thread_init_glib() idempotent --- glib/gthread.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/glib/gthread.c b/glib/gthread.c index 9fc525419..62902b4d2 100644 --- a/glib/gthread.c +++ b/glib/gthread.c @@ -925,6 +925,13 @@ G_LOCK_DEFINE_STATIC (g_thread); void g_thread_init_glib (void) { + static gboolean already_done; + + if (already_done) + return; + + already_done = TRUE; + _g_thread_impl_init (); /* We let the main thread (the one that calls g_thread_init) inherit