X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=blobdiff_plain;f=includes%2FOSThreads.h;h=d79b9affc7586ab64dc290f28a5d3d5e538723d2;hp=9a3b5aa6c74e4371997f890da039b6458f2fc9a5;hb=9131f4adaf4db771a0a628f9e043693ff90a104b;hpb=65ff44face84ae30f1ddf7d009d51c1778f8c7d3 diff --git a/includes/OSThreads.h b/includes/OSThreads.h index 9a3b5aa..d79b9af 100644 --- a/includes/OSThreads.h +++ b/includes/OSThreads.h @@ -16,8 +16,8 @@ #if CMINUSMINUS -#define ACQUIRE_LOCK(mutex) pthread_mutex_lock(mutex) -#define RELEASE_LOCK(mutex) pthread_mutex_unlock(mutex) +#define ACQUIRE_LOCK(mutex) foreign "C" pthread_mutex_lock(mutex) +#define RELEASE_LOCK(mutex) foreign "C" pthread_mutex_unlock(mutex) #define ASSERT_LOCK_HELD(mutex) /* nothing */ #else @@ -82,8 +82,11 @@ typedef pthread_key_t ThreadLocalKey; #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) foreign "stdcall" EnterCriticalSection(mutex) +#define RELEASE_LOCK(mutex) foreign "stdcall" LeaveCriticalSection(mutex) #define ASSERT_LOCK_HELD(mutex) /* nothing */ #else