BIND 10 master, updated. 42c638e07a45b69d902a51b35838ae21ac19d116 [master] Check for EDEADLK too when using Mutex::tryLock()
BIND 10 source code commits
bind10-changes at lists.isc.org
Tue Oct 16 17:38:56 UTC 2012
The branch, master has been updated
via 42c638e07a45b69d902a51b35838ae21ac19d116 (commit)
from 8d321e3ea9f85227296cfac94a9ce79c7db70fdf (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 42c638e07a45b69d902a51b35838ae21ac19d116
Author: Mukund Sivaraman <muks at isc.org>
Date: Tue Oct 16 11:54:19 2012 +0530
[master] Check for EDEADLK too when using Mutex::tryLock()
-----------------------------------------------------------------------
Summary of changes:
src/lib/util/threads/lock.cc | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
-----------------------------------------------------------------------
diff --git a/src/lib/util/threads/lock.cc b/src/lib/util/threads/lock.cc
index acc73d6..c3c818e 100644
--- a/src/lib/util/threads/lock.cc
+++ b/src/lib/util/threads/lock.cc
@@ -123,7 +123,13 @@ bool
Mutex::tryLock() {
assert(impl_ != NULL);
const int result = pthread_mutex_trylock(&impl_->mutex);
- if (result == EBUSY) {
+
+ // In the case of pthread_mutex_trylock(), if it is called on a
+ // locked mutex from the same thread, some platforms (such as fedora
+ // and debian) return EBUSY whereas others (such as centos 5) return
+ // EDEADLK. We return false and don't pass the lock attempt in both
+ // cases.
+ if (result == EBUSY || result == EDEADLK) {
return (false);
} else if (result != 0) {
isc_throw(isc::InvalidOperation, std::strerror(result));
More information about the bind10-changes
mailing list