When calling EnterCriticalSection and LeaveCriticalSection from C--
code, we go via wrappers which use ccall (rather than stdcall).
#if CMINUSMINUS
-#define ACQUIRE_LOCK(mutex) EnterCriticalSection(mutex)
-#define RELEASE_LOCK(mutex) LeaveCriticalSection(mutex)
+/* We jump through a hoop here to get a CCall EnterCriticalSection
+ and LeaveCriticalSection, as that's what C-- wants. */
+
+#define ACQUIRE_LOCK(mutex) CCallEnterCriticalSection(mutex)
+#define RELEASE_LOCK(mutex) CCallLeaveCriticalSection(mutex)
#define ASSERT_LOCK_HELD(mutex) /* nothing */
#else
#if defined(THREADED_RTS)
#include "OSThreads.h"
#include "RtsUtils.h"
+#include <windows.h>
/* For reasons not yet clear, the entire contents of process.h is protected
* by __STRICT_ANSI__ not being defined.
(unsigned*)&pId) == 0);
}
+void CCallEnterCriticalSection(LPCRITICAL_SECTION s) {
+ EnterCriticalSection(s);
+}
+
+void CCallLeaveCriticalSection(LPCRITICAL_SECTION s) {
+ LeaveCriticalSection(s);
+}
+
#else /* !defined(THREADED_RTS) */
int