aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/restricted/abseil-cpp-tstring/y_absl/synchronization/mutex.h
diff options
context:
space:
mode:
authorthegeorg <thegeorg@yandex-team.com>2024-08-06 11:28:07 +0300
committerthegeorg <thegeorg@yandex-team.com>2024-08-06 12:50:21 +0300
commitde4d7efd8871b850e3ea79164d7661e2299836b7 (patch)
tree47d8cf597b3789a807a4b1cec0a9fd66788767c2 /contrib/restricted/abseil-cpp-tstring/y_absl/synchronization/mutex.h
parente003b4c129e1381591dcb75a96bf9a970b2b47fb (diff)
downloadydb-de4d7efd8871b850e3ea79164d7661e2299836b7.tar.gz
Update contrib/restricted/abseil-cpp-tstring to 20240722.0
83a5727000e16bc5a94523a0cf1cce75fa86a191
Diffstat (limited to 'contrib/restricted/abseil-cpp-tstring/y_absl/synchronization/mutex.h')
-rw-r--r--contrib/restricted/abseil-cpp-tstring/y_absl/synchronization/mutex.h9
1 files changed, 5 insertions, 4 deletions
diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/synchronization/mutex.h b/contrib/restricted/abseil-cpp-tstring/y_absl/synchronization/mutex.h
index 6dae8b408d..7dfefad6e6 100644
--- a/contrib/restricted/abseil-cpp-tstring/y_absl/synchronization/mutex.h
+++ b/contrib/restricted/abseil-cpp-tstring/y_absl/synchronization/mutex.h
@@ -148,7 +148,7 @@ struct SynchWaitParams;
//
// See also `MutexLock`, below, for scoped `Mutex` acquisition.
-class Y_ABSL_LOCKABLE Mutex {
+class Y_ABSL_LOCKABLE Y_ABSL_ATTRIBUTE_WARN_UNUSED Mutex {
public:
// Creates a `Mutex` that is not held by anyone. This constructor is
// typically used for Mutexes allocated on the heap or the stack.
@@ -190,7 +190,7 @@ class Y_ABSL_LOCKABLE Mutex {
// If the mutex can be acquired without blocking, does so exclusively and
// returns `true`. Otherwise, returns `false`. Returns `true` with high
// probability if the `Mutex` was free.
- bool TryLock() Y_ABSL_EXCLUSIVE_TRYLOCK_FUNCTION(true);
+ Y_ABSL_MUST_USE_RESULT bool TryLock() Y_ABSL_EXCLUSIVE_TRYLOCK_FUNCTION(true);
// Mutex::AssertHeld()
//
@@ -255,7 +255,7 @@ class Y_ABSL_LOCKABLE Mutex {
// If the mutex can be acquired without blocking, acquires this mutex for
// shared access and returns `true`. Otherwise, returns `false`. Returns
// `true` with high probability if the `Mutex` was free or shared.
- bool ReaderTryLock() Y_ABSL_SHARED_TRYLOCK_FUNCTION(true);
+ Y_ABSL_MUST_USE_RESULT bool ReaderTryLock() Y_ABSL_SHARED_TRYLOCK_FUNCTION(true);
// Mutex::AssertReaderHeld()
//
@@ -281,7 +281,8 @@ class Y_ABSL_LOCKABLE Mutex {
void WriterUnlock() Y_ABSL_UNLOCK_FUNCTION() { this->Unlock(); }
- bool WriterTryLock() Y_ABSL_EXCLUSIVE_TRYLOCK_FUNCTION(true) {
+ Y_ABSL_MUST_USE_RESULT bool WriterTryLock()
+ Y_ABSL_EXCLUSIVE_TRYLOCK_FUNCTION(true) {
return this->TryLock();
}