Commit 11df86c5 authored by Mukund Sivaraman's avatar Mukund Sivaraman
Browse files

[2198] Check pthread_mutex_trylock()'s return value

parent 699a941c
......@@ -132,8 +132,10 @@ bool
Mutex::tryLock() {
assert(impl_ != NULL);
const int result = pthread_mutex_trylock(&impl_->mutex);
if (result != 0) {
if (result == EBUSY) {
return (false);
} else if (result != 0) {
isc_throw(isc::InvalidOperation, std::strerror(result));
}
postLockAction(); // Only in debug mode
return (true);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment