aboutsummaryrefslogtreecommitdiff
path: root/coroutine-gthread.c
diff options
context:
space:
mode:
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();