summaryrefslogtreecommitdiff
path: root/absl/synchronization/mutex.h
diff options
context:
space:
mode:
Diffstat (limited to 'absl/synchronization/mutex.h')
-rw-r--r--absl/synchronization/mutex.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/absl/synchronization/mutex.h b/absl/synchronization/mutex.h
index 876698ca..52401fe3 100644
--- a/absl/synchronization/mutex.h
+++ b/absl/synchronization/mutex.h
@@ -685,6 +685,11 @@ class Condition {
// return processed_ >= current;
// };
// mu_.Await(Condition(&reached));
+ //
+ // NOTE: never use "mu_.AssertHeld()" instead of "mu_.AssertReadHeld()" in the
+ // lambda as it may be called when the mutex is being unlocked from a scope
+ // holding only a reader lock, which will make the assertion not fulfilled and
+ // crash the binary.
// See class comment for performance advice. In particular, if there
// might be more than one waiter for the same condition, make sure