From db529aabfac17201d3647384abf89fc7f272b493 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20F=C3=A4rber?= Date: Mon, 31 Oct 2011 19:14:56 +0100 Subject: vl.c: Guard against GThread double-initialization MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Signed-off-by: Andreas Färber Cc: Daniel P. Berrange --- vl.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/vl.c b/vl.c index b56e0cb..624da0f 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(); -- cgit v1.1