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:
ff124db
)
add comment for ASSERT_LOCK_HELD()
author
Simon Marlow
<marlowsd@gmail.com>
Mon, 26 Jan 2009 14:00:30 +0000
(14:00 +0000)
committer
Simon Marlow
<marlowsd@gmail.com>
Mon, 26 Jan 2009 14:00:30 +0000
(14:00 +0000)
includes/OSThreads.h
patch
|
blob
|
history
diff --git
a/includes/OSThreads.h
b/includes/OSThreads.h
index
fd57f56
..
d4dbc36
100644
(file)
--- a/
includes/OSThreads.h
+++ b/
includes/OSThreads.h
@@
-54,6
+54,11
@@
typedef pthread_key_t ThreadLocalKey;
barf("RELEASE_LOCK: I do not own this lock: %s %d", __FILE__,__LINE__); \
}
barf("RELEASE_LOCK: I do not own this lock: %s %d", __FILE__,__LINE__); \
}
+// Note: this assertion calls pthread_mutex_lock() on a mutex that
+// is already held by the calling thread. The mutex should therefore
+// have been created with PTHREAD_MUTEX_ERRORCHECK, otherwise this
+// assertion will hang. We always initialise mutexes with
+// PTHREAD_MUTEX_ERRORCHECK when DEBUG is on (see rts/posix/OSThreads.h).
#define ASSERT_LOCK_HELD(mutex) ASSERT(pthread_mutex_lock(mutex) == EDEADLK)
#endif // CMINUSMINUS
#define ASSERT_LOCK_HELD(mutex) ASSERT(pthread_mutex_lock(mutex) == EDEADLK)
#endif // CMINUSMINUS