1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-10-27 12:15:34 +03:00
Files
libxml2/include/private/threads.h
Nick Wellnhofer a07ec7c1a7 threads: Move library initialization code to threads.c
This allows to consolidate the initialization code since the global init
lock was already implemented in threads.c.
2023-09-19 17:35:12 +02:00

39 lines
755 B
C

#ifndef XML_THREADS_H_PRIVATE__
#define XML_THREADS_H_PRIVATE__
#include <libxml/threads.h>
#ifdef LIBXML_THREAD_ENABLED
#ifdef HAVE_PTHREAD_H
#include <pthread.h>
#define HAVE_POSIX_THREADS
#elif defined(_WIN32)
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#ifndef HAVE_COMPILER_TLS
#include <process.h>
#endif
#define HAVE_WIN32_THREADS
#endif
#endif
/*
* xmlMutex are a simple mutual exception locks
*/
struct _xmlMutex {
#ifdef HAVE_POSIX_THREADS
pthread_mutex_t lock;
#elif defined HAVE_WIN32_THREADS
CRITICAL_SECTION cs;
#else
int empty;
#endif
};
XML_HIDDEN void
xmlInitMutex(xmlMutexPtr mutex);
XML_HIDDEN void
xmlCleanupMutex(xmlMutexPtr mutex);
#endif /* XML_THREADS_H_PRIVATE__ */