1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-10-28 23:14:57 +03:00

threads: Fix crash with weak pthread symbols

Regressed in 7010d877. Should fix #488.
This commit is contained in:
Nick Wellnhofer
2023-02-20 10:56:03 +01:00
parent 5d55315e32
commit 7bd77873db

View File

@@ -752,6 +752,8 @@ xmlInitThreadsInternal(void)
*/ */
if (libxml_is_threaded == -1) if (libxml_is_threaded == -1)
libxml_is_threaded = (pthread_mutex_lock != NULL); libxml_is_threaded = (pthread_mutex_lock != NULL);
if (libxml_is_threaded == 0)
return;
#endif /* XML_PTHREAD_WEAK */ #endif /* XML_PTHREAD_WEAK */
pthread_key_create(&globalkey, xmlFreeGlobalState); pthread_key_create(&globalkey, xmlFreeGlobalState);
mainthread = pthread_self(); mainthread = pthread_self();