Skip to content

Commit 7fc86c6

Browse files
Abseil Teamcopybara-github
authored andcommitted
Fix inconsistent nullability annotation in ReleasableMutexLock
ReleasableMutexLock::Release() resets this pointers, so destructor can compare it to nullptr, to avoid double release. PiperOrigin-RevId: 803163168 Change-Id: Ib97f86a4e5fca789552b1a8c385868d4227b9874
1 parent f8c283d commit 7fc86c6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

absl/synchronization/mutex.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1123,7 +1123,7 @@ class ABSL_SCOPED_LOCKABLE ReleasableMutexLock {
11231123
void Release() ABSL_UNLOCK_FUNCTION();
11241124

11251125
private:
1126-
Mutex* absl_nonnull mu_;
1126+
Mutex* absl_nullable mu_;
11271127
ReleasableMutexLock(const ReleasableMutexLock&) = delete;
11281128
ReleasableMutexLock(ReleasableMutexLock&&) = delete;
11291129
ReleasableMutexLock& operator=(const ReleasableMutexLock&) = delete;

0 commit comments

Comments
 (0)