summaryrefslogtreecommitdiff
path: root/coroutine-gthread.c
diff options
context:
space:
mode:
authorAlon Levy <alevy@redhat.com>2011-12-20 13:41:04 +0200
committerAnthony Liguori <aliguori@us.ibm.com>2011-12-20 15:44:31 -0600
commit42ed3727536ccf80c87942b3f04e7378fe90f107 (patch)
treec2bc4fe0dc174f3c8925d76768c69ccc4701418b /coroutine-gthread.c
parent4a0f031d5bd2399eec5eea062e44b5271a855faf (diff)
downloadqemu-42ed3727536ccf80c87942b3f04e7378fe90f107.tar.gz
qemu-42ed3727536ccf80c87942b3f04e7378fe90f107.tar.bz2
qemu-42ed3727536ccf80c87942b3f04e7378fe90f107.zip
g_thread_init users: don't call it if glib >= 2.31
since commit f9b29ca03 included in release 2.31 (docs below say 2.32 but that is not correct) and onwards g_thread_init is deprecated and calling it is not required: http://developer.gnome.org/glib/unstable/glib-Deprecated-Thread-APIs.html#g-thread-init g_thread_init has been deprecated since version 2.32 and should not be used in newly-written code. This function is no longer necessary. The GLib threading system is automatically initialized at the start of your program. Fixes bulid failure when warnings are treated as errors on fedora 17. I only tested the change to vl.c, and copy pasted to the two other locations (couldn't decide if a wrapper for calling g_thread_init is uglier). Signed-off-by: Alon Levy <alevy@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'coroutine-gthread.c')
-rw-r--r--coroutine-gthread.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/coroutine-gthread.c b/coroutine-gthread.c
index fdea27a106..662801b2fa 100644
--- a/coroutine-gthread.c
+++ b/coroutine-gthread.c
@@ -36,7 +36,12 @@ static GStaticPrivate coroutine_key = G_STATIC_PRIVATE_INIT;
static void __attribute__((constructor)) coroutine_init(void)
{
if (!g_thread_supported()) {
+#if !GLIB_CHECK_VERSION(2, 31, 0)
g_thread_init(NULL);
+#else
+ fprintf(stderr, "glib threading failed to initialize.\n");
+ exit(1);
+#endif
}
coroutine_cond = g_cond_new();