1 | /**
|
---|
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
|
---|
17 | extern "C" {
|
---|
18 | #endif
|
---|
19 |
|
---|
20 | /*
|
---|
21 | * xmlMutex are a simple mutual exception locks.
|
---|
22 | */
|
---|
23 | typedef struct _xmlMutex xmlMutex;
|
---|
24 | typedef xmlMutex *xmlMutexPtr;
|
---|
25 |
|
---|
26 | /*
|
---|
27 | * xmlRMutex are reentrant mutual exception locks.
|
---|
28 | */
|
---|
29 | typedef struct _xmlRMutex xmlRMutex;
|
---|
30 | typedef xmlRMutex *xmlRMutexPtr;
|
---|
31 |
|
---|
32 | XMLPUBFUN int
|
---|
33 | xmlCheckThreadLocalStorage(void);
|
---|
34 |
|
---|
35 | XMLPUBFUN xmlMutexPtr
|
---|
36 | xmlNewMutex (void);
|
---|
37 | XMLPUBFUN void
|
---|
38 | xmlMutexLock (xmlMutexPtr tok);
|
---|
39 | XMLPUBFUN void
|
---|
40 | xmlMutexUnlock (xmlMutexPtr tok);
|
---|
41 | XMLPUBFUN void
|
---|
42 | xmlFreeMutex (xmlMutexPtr tok);
|
---|
43 |
|
---|
44 | XMLPUBFUN xmlRMutexPtr
|
---|
45 | xmlNewRMutex (void);
|
---|
46 | XMLPUBFUN void
|
---|
47 | xmlRMutexLock (xmlRMutexPtr tok);
|
---|
48 | XMLPUBFUN void
|
---|
49 | xmlRMutexUnlock (xmlRMutexPtr tok);
|
---|
50 | XMLPUBFUN void
|
---|
51 | xmlFreeRMutex (xmlRMutexPtr tok);
|
---|
52 |
|
---|
53 | /*
|
---|
54 | * Library wide APIs.
|
---|
55 | */
|
---|
56 | XML_DEPRECATED
|
---|
57 | XMLPUBFUN void
|
---|
58 | xmlInitThreads (void);
|
---|
59 | XMLPUBFUN void
|
---|
60 | xmlLockLibrary (void);
|
---|
61 | XMLPUBFUN void
|
---|
62 | xmlUnlockLibrary(void);
|
---|
63 | XML_DEPRECATED
|
---|
64 | XMLPUBFUN int
|
---|
65 | xmlGetThreadId (void);
|
---|
66 | XML_DEPRECATED
|
---|
67 | XMLPUBFUN int
|
---|
68 | xmlIsMainThread (void);
|
---|
69 | XML_DEPRECATED
|
---|
70 | XMLPUBFUN void
|
---|
71 | xmlCleanupThreads(void);
|
---|
72 |
|
---|
73 | /** DOC_DISABLE */
|
---|
74 | #if defined(LIBXML_THREAD_ENABLED) && defined(_WIN32) && \
|
---|
75 | defined(LIBXML_STATIC_FOR_DLL)
|
---|
76 | int
|
---|
77 | xmlDllMain(void *hinstDLL, unsigned long fdwReason,
|
---|
78 | void *lpvReserved);
|
---|
79 | #endif
|
---|
80 | /** DOC_ENABLE */
|
---|
81 |
|
---|
82 | #ifdef __cplusplus
|
---|
83 | }
|
---|
84 | #endif
|
---|
85 |
|
---|
86 |
|
---|
87 | #endif /* __XML_THREADS_H__ */
|
---|