projects
/
ghc-hetmet.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix stack check amount for user declared continuation functions
[ghc-hetmet.git]
/
includes
/
OSThreads.h
diff --git
a/includes/OSThreads.h
b/includes/OSThreads.h
index
fd50642
..
9a3b5aa
100644
(file)
--- a/
includes/OSThreads.h
+++ b/
includes/OSThreads.h
@@
-14,6
+14,14
@@
# if defined(HAVE_PTHREAD_H) && !defined(WANT_NATIVE_WIN32_THREADS)
# if defined(HAVE_PTHREAD_H) && !defined(WANT_NATIVE_WIN32_THREADS)
+#if CMINUSMINUS
+
+#define ACQUIRE_LOCK(mutex) pthread_mutex_lock(mutex)
+#define RELEASE_LOCK(mutex) pthread_mutex_unlock(mutex)
+#define ASSERT_LOCK_HELD(mutex) /* nothing */
+
+#else
+
#include <pthread.h>
typedef pthread_cond_t Condition;
#include <pthread.h>
typedef pthread_cond_t Condition;
@@
-68,7
+76,18
@@
typedef pthread_key_t ThreadLocalKey;
#endif
#endif
+#endif // CMINUSMINUS
+
# elif defined(HAVE_WINDOWS_H)
# elif defined(HAVE_WINDOWS_H)
+
+#if CMINUSMINUS
+
+#define ACQUIRE_LOCK(mutex) EnterCriticalSection(mutex)
+#define RELEASE_LOCK(mutex) LeaveCriticalSection(mutex)
+#define ASSERT_LOCK_HELD(mutex) /* nothing */
+
+#else
+
#include <windows.h>
typedef HANDLE Condition;
#include <windows.h>
typedef HANDLE Condition;
@@
-133,10
+152,14
@@
typedef HANDLE Mutex;
#define ASSERT_LOCK_HELD(mutex) /* nothing */
#endif
#define ASSERT_LOCK_HELD(mutex) /* nothing */
#endif
+#endif // CMINUSMINUS
+
# else
# error "Threads not supported"
# endif
# else
# error "Threads not supported"
# endif
+
+#ifndef CMINUSMINUS
//
// General thread operations
//
//
// General thread operations
//
@@
-174,6
+197,8
@@
void *getThreadLocalVar (ThreadLocalKey *key);
void setThreadLocalVar (ThreadLocalKey *key, void *value);
void freeThreadLocalKey (ThreadLocalKey *key);
void setThreadLocalVar (ThreadLocalKey *key, void *value);
void freeThreadLocalKey (ThreadLocalKey *key);
+#endif // !CMINUSMINUS
+
#else
#define ACQUIRE_LOCK(l)
#else
#define ACQUIRE_LOCK(l)