Add closeMutex and use it on clean up
[ghc-hetmet.git] / rts / win32 / OSThreads.c
index c772be3..00effda 100644 (file)
@@ -116,6 +116,11 @@ initMutex (Mutex* pMut)
 {
     InitializeCriticalSectionAndSpinCount(pMut,4000);
 }
+void
+closeMutex (Mutex* pMut)
+{
+    DeleteCriticalSection(pMut);
+}
 #else
 void
 initMutex (Mutex* pMut)
@@ -127,6 +132,11 @@ initMutex (Mutex* pMut)
   *pMut = h;
   return;
 }
+void
+closeMutex (Mutex* pMut)
+{
+    CloseHandle(*pMut);
+}
 #endif
 
 void