Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Glasgow Haskell Compiler
GHC
Commits
9f35f671
Commit
9f35f671
authored
Jan 26, 2009
by
Simon Marlow
Browse files
add comment for ASSERT_LOCK_HELD()
parent
ff124db4
Changes
1
Hide whitespace changes
Inline
Side-by-side
includes/OSThreads.h
View file @
9f35f671
...
...
@@ -54,6 +54,11 @@ typedef pthread_key_t ThreadLocalKey;
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
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment