darcs patch: Always check the result of pthread_mutex_lock() and
pt...
kili at outback.escape.de
kili at outback.escape.de
Sun Jan 11 14:32:48 EST 2009
Sun Jan 4 20:24:43 CET 2009 Matthias Kilian <kili at outback.escape.de>
* Always check the result of pthread_mutex_lock() and pthread_mutex_unlock().
Don't check pthread_mutex_*lock() only on Linux and/or only if DEBUG
is defined. The return values of those functions are well defined
and should be supported on all operation systems with pthreads. The
checks are cheap enough to do them even in the default build (without
-DDEBUG).
While here, recycle an unused macro ASSERT_LOCK_NOTHELD, and let
the debugBelch part enabled with -DLOCK_DEBUG work independently
of -DDEBUG.
I've tested this on OpenBSD/i386 with the complete testsuite, and
results are the same than without the patch. However, it may break
on other systems with pthreads (Linux should still work). Some
testing would be nice.
Ciao,
Kili
-------------- next part --------------
A non-text attachment was scrubbed...
Name: always-check-the-result-of-pthread_mutex_lock__-and-pthread_mutex_unlock___.dpatch
Type: text/x-darcs-patch
Size: 139635 bytes
Desc: A darcs patch for your repository!
Url : http://www.haskell.org/pipermail/cvs-ghc/attachments/20090111/9f881dfb/always-check-the-result-of-pthread_mutex_lock__-and-pthread_mutex_unlock___-0001.bin
More information about the Cvs-ghc
mailing list