From e4e8806dca7fc9f61941124be5c379846fda3330 Mon Sep 17 00:00:00 2001 From: Pan Liu Date: Sat, 8 Jul 2017 13:49:28 +0800 Subject: [PATCH] common/Mutex.cc: fixed the error in comment Signed-off-by: Pan Liu --- src/common/Mutex.cc | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/common/Mutex.cc b/src/common/Mutex.cc index 6ac022c8af0..1bb588902d0 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); } } -- 2.39.5