aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tests/test-qmp-event.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/test-qmp-event.c b/tests/test-qmp-event.c
index cb1e441..cb354e6 100644
--- a/tests/test-qmp-event.c
+++ b/tests/test-qmp-event.c
@@ -251,6 +251,12 @@ static void test_event_d(TestEventData *data,
int main(int argc, char **argv)
{
+#if !GLIB_CHECK_VERSION(2, 31, 0)
+ if (!g_thread_supported()) {
+ g_thread_init(NULL);
+ }
+#endif
+
qmp_event_set_func_emit(event_test_emit);
g_test_init(&argc, &argv, NULL);