[glib] make g_thread_init_glib() idempotent
- From: Ryan Lortie <ryanl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib] make g_thread_init_glib() idempotent
- Date: Fri, 9 Sep 2011 17:10:24 +0000 (UTC)
commit 6c0dda8265a547d89b4c546298d0a29519f68749
Author: Ryan Lortie <desrt desrt ca>
Date: Wed Aug 31 18:07:55 2011 -0400
make g_thread_init_glib() idempotent
glib/gthread.c | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
---
diff --git a/glib/gthread.c b/glib/gthread.c
index 9fc5254..62902b4 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
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]