Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame^] | 1 | /** |
| 2 | * threads.c: set of generic threading related routines |
| 3 | * |
| 4 | * See Copyright for the status of this software. |
| 5 | * |
| 6 | * daniel@veillard.com |
| 7 | */ |
| 8 | |
| 9 | #ifndef __XML_THREADS_H__ |
| 10 | #define __XML_THREADS_H__ |
| 11 | |
| 12 | #include <libxml/globals.h> |
| 13 | |
| 14 | #ifdef __cplusplus |
| 15 | extern "C" { |
| 16 | #endif |
| 17 | |
| 18 | /* |
| 19 | * xmlMutex are a simple mutual exception locks |
| 20 | */ |
| 21 | typedef struct _xmlMutex xmlMutex; |
| 22 | typedef xmlMutex *xmlMutexPtr; |
| 23 | |
| 24 | xmlMutexPtr xmlNewMutex (void); |
| 25 | void xmlMutexLock (xmlMutexPtr tok); |
| 26 | void xmlMutexUnlock (xmlMutexPtr tok); |
| 27 | void xmlFreeMutex (xmlMutexPtr tok); |
| 28 | |
| 29 | /* |
| 30 | * xmlRMutex are reentrant mutual exception locks |
| 31 | */ |
| 32 | typedef struct _xmlRMutex xmlRMutex; |
| 33 | typedef xmlRMutex *xmlRMutexPtr; |
| 34 | |
| 35 | xmlRMutexPtr xmlNewRMutex (void); |
| 36 | void xmlRMutexLock (xmlRMutexPtr tok); |
| 37 | void xmlRMutexUnlock (xmlRMutexPtr tok); |
| 38 | void xmlFreeRMutex (xmlRMutexPtr tok); |
| 39 | |
| 40 | /* |
| 41 | * Library wide APIs |
| 42 | */ |
| 43 | void xmlInitThreads (void); |
| 44 | void xmlLockLibrary (void); |
| 45 | void xmlUnlockLibrary(void); |
| 46 | void xmlCleanupThreads(void); |
| 47 | xmlGlobalStatePtr xmlGetGlobalState(void); |
| 48 | |
| 49 | #ifdef __cplusplus |
| 50 | } |
| 51 | #endif |
| 52 | |
| 53 | |
| 54 | #endif /* __XML_THREADS_H__ */ |