[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v2 3/4] vl.c: Guard against GThread double-initializ
From: |
Andreas Färber |
Subject: |
[Qemu-devel] [PATCH v2 3/4] vl.c: Guard against GThread double-initialization |
Date: |
Mon, 31 Oct 2011 20:18:01 +0100 |
GThread-ERROR **: GThread system may only be initialized once.
aborting...
Making the g_thread_init() call in vl.c conditional resolves an abort on
Mac OS X, where coroutine-gthread.c seems to call it before vl.c.
Reported-by: Juan Pineda <address@hidden>
Signed-off-by: Andreas Färber <address@hidden>
Cc: Daniel P. Berrange <address@hidden>
---
vl.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/vl.c b/vl.c
index 1ddb17b..46b2909 100644
--- a/vl.c
+++ b/vl.c
@@ -2185,7 +2185,9 @@ int main(int argc, char **argv, char **envp)
error_set_progname(argv[0]);
g_mem_set_vtable(&mem_trace);
- g_thread_init(NULL);
+ if (!g_thread_supported()) {
+ g_thread_init(NULL);
+ }
runstate_init();
--
1.7.0.3