X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=includes%2FOSThreads.h;h=dd7f91a92dc8d9a0cf88449555e9b67dbd57a091;hb=db01886e22bd80de8d94a8d5e71d2ca645cb7a8e;hp=32429b5794ce7de58ca249b291e4293b1c3bc0dc;hpb=16ed3e3cd3ba05ae7222f8da2c80f8294540817d;p=ghc-hetmet.git diff --git a/includes/OSThreads.h b/includes/OSThreads.h index 32429b5..dd7f91a 100644 --- a/includes/OSThreads.h +++ b/includes/OSThreads.h @@ -79,6 +79,18 @@ typedef pthread_key_t ThreadLocalKey; #endif // CMINUSMINUS # elif defined(HAVE_WINDOWS_H) + +#if CMINUSMINUS + +/* 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 + #include typedef HANDLE Condition; @@ -143,6 +155,8 @@ typedef HANDLE Mutex; #define ASSERT_LOCK_HELD(mutex) /* nothing */ #endif +#endif // CMINUSMINUS + # else # error "Threads not supported" # endif