projects
/
ghc-hetmet.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
0ab0232
)
support LOCK_DEBUG for Windows
author
kr.angelov@gmail.com
<unknown>
Wed, 22 Feb 2006 20:17:21 +0000
(20:17 +0000)
committer
kr.angelov@gmail.com
<unknown>
Wed, 22 Feb 2006 20:17:21 +0000
(20:17 +0000)
ghc/includes/OSThreads.h
patch
|
blob
|
history
diff --git
a/ghc/includes/OSThreads.h
b/ghc/includes/OSThreads.h
index
40c260b
..
9043144
100644
(file)
--- a/
ghc/includes/OSThreads.h
+++ b/
ghc/includes/OSThreads.h
@@
-90,6
+90,19
@@
typedef DWORD ThreadLocalKey;
#if USE_CRITICAL_SECTIONS
typedef CRITICAL_SECTION Mutex;
#if USE_CRITICAL_SECTIONS
typedef CRITICAL_SECTION Mutex;
+
+#ifdef LOCK_DEBUG
+
+#define ACQUIRE_LOCK(mutex) \
+ debugBelch("ACQUIRE_LOCK(0x%p) %s %d\n", mutex,__FILE__,__LINE__); \
+ EnterCriticalSection(mutex)
+#define RELEASE_LOCK(mutex) \
+ debugBelch("RELEASE_LOCK(0x%p) %s %d\n", mutex,__FILE__,__LINE__); \
+ LeaveCriticalSection(mutex)
+#define ASSERT_LOCK_HELD(mutex) /* nothing */
+
+#else
+
#define ACQUIRE_LOCK(mutex) EnterCriticalSection(mutex)
#define RELEASE_LOCK(mutex) LeaveCriticalSection(mutex)
#define ACQUIRE_LOCK(mutex) EnterCriticalSection(mutex)
#define RELEASE_LOCK(mutex) LeaveCriticalSection(mutex)
@@
-97,6
+110,8
@@
typedef CRITICAL_SECTION Mutex;
// the right thing.
#define ASSERT_LOCK_HELD(mutex) /* nothing */
// the right thing.
#define ASSERT_LOCK_HELD(mutex) /* nothing */
+#endif
+
#else
typedef HANDLE Mutex;
#else
typedef HANDLE Mutex;