]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
common/Mutex.cc: fixed the error in comment
authorPan Liu <wanjun.lp@alibaba-inc.com>
Sat, 8 Jul 2017 05:49:28 +0000 (13:49 +0800)
committerPan Liu <wanjun.lp@alibaba-inc.com>
Sat, 8 Jul 2017 05:49:28 +0000 (13:49 +0800)
Signed-off-by: Pan Liu <wanjun.lp@alibaba-inc.com>
src/common/Mutex.cc

index 6ac022c8af05111c3acf95966bc4a5fad6d03b0a..1bb588902d00c5c1a8cfee9ee5b2f95374fef74a 100644 (file)
@@ -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);
   }
 }