From 7bd77873db01a831e39cd3aadaee16cd1317b00e Mon Sep 17 00:00:00 2001 From: Nick Wellnhofer Date: Mon, 20 Feb 2023 10:56:03 +0100 Subject: [PATCH] threads: Fix crash with weak pthread symbols Regressed in 7010d877. Should fix #488. --- threads.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/threads.c b/threads.c index f3e2b31f..36e5df1d 100644 --- a/threads.c +++ b/threads.c @@ -752,6 +752,8 @@ xmlInitThreadsInternal(void) */ if (libxml_is_threaded == -1) libxml_is_threaded = (pthread_mutex_lock != NULL); + if (libxml_is_threaded == 0) + return; #endif /* XML_PTHREAD_WEAK */ pthread_key_create(&globalkey, xmlFreeGlobalState); mainthread = pthread_self();