blob: d31f16acbd416bebdcc484077d53aa9ad199532a [file] [log] [blame]
The Android Open Source Projectab4e2e92009-03-03 19:30:06 -08001/**
2 * Summary: interfaces for thread handling
3 * Description: set of generic threading related routines
4 * should work with pthreads, Windows native or TLS threads
5 *
6 * Copy: See Copyright for the status of this software.
7 *
8 * Author: Daniel Veillard
9 */
10
11#ifndef __XML_THREADS_H__
12#define __XML_THREADS_H__
13
14#include <libxml/xmlversion.h>
15
16#ifdef __cplusplus
17extern "C" {
18#endif
19
20/*
21 * xmlMutex are a simple mutual exception locks.
22 */
23typedef struct _xmlMutex xmlMutex;
24typedef xmlMutex *xmlMutexPtr;
25
26/*
27 * xmlRMutex are reentrant mutual exception locks.
28 */
29typedef struct _xmlRMutex xmlRMutex;
30typedef xmlRMutex *xmlRMutexPtr;
31
32#ifdef __cplusplus
33}
34#endif
35#include <libxml/globals.h>
36#ifdef __cplusplus
37extern "C" {
38#endif
Patrick Scott60a4c352009-07-09 09:30:54 -040039XMLPUBFUN xmlMutexPtr XMLCALL
The Android Open Source Projectab4e2e92009-03-03 19:30:06 -080040 xmlNewMutex (void);
Patrick Scott60a4c352009-07-09 09:30:54 -040041XMLPUBFUN void XMLCALL
The Android Open Source Projectab4e2e92009-03-03 19:30:06 -080042 xmlMutexLock (xmlMutexPtr tok);
Patrick Scott60a4c352009-07-09 09:30:54 -040043XMLPUBFUN void XMLCALL
The Android Open Source Projectab4e2e92009-03-03 19:30:06 -080044 xmlMutexUnlock (xmlMutexPtr tok);
Patrick Scott60a4c352009-07-09 09:30:54 -040045XMLPUBFUN void XMLCALL
The Android Open Source Projectab4e2e92009-03-03 19:30:06 -080046 xmlFreeMutex (xmlMutexPtr tok);
47
Patrick Scott60a4c352009-07-09 09:30:54 -040048XMLPUBFUN xmlRMutexPtr XMLCALL
The Android Open Source Projectab4e2e92009-03-03 19:30:06 -080049 xmlNewRMutex (void);
Patrick Scott60a4c352009-07-09 09:30:54 -040050XMLPUBFUN void XMLCALL
The Android Open Source Projectab4e2e92009-03-03 19:30:06 -080051 xmlRMutexLock (xmlRMutexPtr tok);
Patrick Scott60a4c352009-07-09 09:30:54 -040052XMLPUBFUN void XMLCALL
The Android Open Source Projectab4e2e92009-03-03 19:30:06 -080053 xmlRMutexUnlock (xmlRMutexPtr tok);
Patrick Scott60a4c352009-07-09 09:30:54 -040054XMLPUBFUN void XMLCALL
The Android Open Source Projectab4e2e92009-03-03 19:30:06 -080055 xmlFreeRMutex (xmlRMutexPtr tok);
56
57/*
58 * Library wide APIs.
59 */
Patrick Scott60a4c352009-07-09 09:30:54 -040060XMLPUBFUN void XMLCALL
The Android Open Source Projectab4e2e92009-03-03 19:30:06 -080061 xmlInitThreads (void);
Patrick Scott60a4c352009-07-09 09:30:54 -040062XMLPUBFUN void XMLCALL
The Android Open Source Projectab4e2e92009-03-03 19:30:06 -080063 xmlLockLibrary (void);
Patrick Scott60a4c352009-07-09 09:30:54 -040064XMLPUBFUN void XMLCALL
The Android Open Source Projectab4e2e92009-03-03 19:30:06 -080065 xmlUnlockLibrary(void);
Patrick Scott60a4c352009-07-09 09:30:54 -040066XMLPUBFUN int XMLCALL
The Android Open Source Projectab4e2e92009-03-03 19:30:06 -080067 xmlGetThreadId (void);
Patrick Scott60a4c352009-07-09 09:30:54 -040068XMLPUBFUN int XMLCALL
The Android Open Source Projectab4e2e92009-03-03 19:30:06 -080069 xmlIsMainThread (void);
Patrick Scott60a4c352009-07-09 09:30:54 -040070XMLPUBFUN void XMLCALL
The Android Open Source Projectab4e2e92009-03-03 19:30:06 -080071 xmlCleanupThreads(void);
Patrick Scott60a4c352009-07-09 09:30:54 -040072XMLPUBFUN xmlGlobalStatePtr XMLCALL
The Android Open Source Projectab4e2e92009-03-03 19:30:06 -080073 xmlGetGlobalState(void);
74
75#if defined(HAVE_WIN32_THREADS) && !defined(HAVE_COMPILER_TLS) && defined(LIBXML_STATIC_FOR_DLL)
76int XMLCALL xmlDllMain(void *hinstDLL, unsigned long fdwReason, void *lpvReserved);
77#endif
78
79#ifdef __cplusplus
80}
81#endif
82
83
84#endif /* __XML_THREADS_H__ */