From: Pan Liu Date: Sat, 8 Jul 2017 05:49:28 +0000 (+0800) Subject: common/Mutex.cc: fixed the error in comment X-Git-Tag: v12.1.1~108^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F16214%2Fhead;p=ceph.git common/Mutex.cc: fixed the error in comment Signed-off-by: Pan Liu --- diff --git a/src/common/Mutex.cc b/src/common/Mutex.cc index 6ac022c8af05..1bb588902d00 100644 --- a/src/common/Mutex.cc +++ b/src/common/Mutex.cc @@ -61,10 +61,11 @@ Mutex::Mutex(const std::string &n, bool r, bool ld, _register(); } else { - // If the mutex type is PTHREAD_MUTEX_NORMAL, deadlock detection - // shall not be provided. Attempting to relock the mutex causes - // deadlock. If a thread attempts to unlock a mutex that it has not - // locked or a mutex which is unlocked, undefined behavior results. + // If the mutex type is PTHREAD_MUTEX_DEFAULT, attempting to recursively + // lock the mutex results in undefined behavior. Attempting to unlock the + // mutex if it was not locked by the calling thread results in undefined + // behavior. Attempting to unlock the mutex if it is not locked results in + // undefined behavior. pthread_mutex_init(&_m, NULL); } }