summaryrefslogtreecommitdiff
path: root/threads.c
diff options
context:
space:
mode:
authorRob Richards <rrichard@src.gnome.org>2007-11-16 10:54:59 +0000
committerRob Richards <rrichard@src.gnome.org>2007-11-16 10:54:59 +0000
commit91eb560c7c6d154a8918735a4363c6f85fa6f282 (patch)
tree0081a3f5f75b87eec7035c0cb40511805d2ade00 /threads.c
parentb9ba0facb5ea803d40005e47b9e721df96995041 (diff)
downloadlibxml2-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.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/threads.c b/threads.c
index 0ab9e771..08c5ba3a 100644
--- a/threads.c
+++ b/threads.c
@@ -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 *