diff options
author | Rob Richards <rrichard@src.gnome.org> | 2007-11-16 10:54:59 +0000 |
---|---|---|
committer | Rob Richards <rrichard@src.gnome.org> | 2007-11-16 10:54:59 +0000 |
commit | 91eb560c7c6d154a8918735a4363c6f85fa6f282 (patch) | |
tree | 0081a3f5f75b87eec7035c0cb40511805d2ade00 /threads.c | |
parent | b9ba0facb5ea803d40005e47b9e721df96995041 (diff) | |
download | libxml2-91eb560c7c6d154a8918735a4363c6f85fa6f282.tar.gz |
__xmlGlobalInitMutexDestroy() will free global_init_lock on Win32. Patch
* globals.c threads.c include/libxml/threads.h:
__xmlGlobalInitMutexDestroy() will free global_init_lock on Win32.
Patch from Marc-Antoine Ruel.
svn path=/trunk/; revision=3664
Diffstat (limited to 'threads.c')
-rw-r--r-- | threads.c | 19 |
1 files changed, 19 insertions, 0 deletions
@@ -451,6 +451,7 @@ __xmlGlobalInitMutexLock(void) * section in the global_init_lock then discard the one * allocated by this thread. */ if (global_init_lock != cs) { + DeleteCriticalSection(cs); free(cs); } } @@ -500,6 +501,24 @@ __xmlGlobalInitMutexUnlock(void) #endif } +/** + * xmlGlobalInitMutexDestroy + * + * Makes sure that the global initialization mutex is destroyed before + * application termination. + */ +void __xmlGlobalInitMutexDestroy(void) +{ +#if defined HAVE_WIN32_THREADS + if (global_init_lock != NULL) + { + DeleteCriticalSection(global_init_lock); + free(global_init_lock); + global_init_lock = NULL; + } +#endif +} + /************************************************************************ * * * Per thread global state handling * |