From 40780b29bda1745ae0b4020fc0a0cb636e198c31 Mon Sep 17 00:00:00 2001 From: Gregory Popovitch Date: Fri, 11 Apr 2025 10:16:33 -0400 Subject: [PATCH] Fix warnings when using `absl::Mutex` (#272) --- parallel_hashmap/phmap_base.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/parallel_hashmap/phmap_base.h b/parallel_hashmap/phmap_base.h index c845706..30e206e 100644 --- a/parallel_hashmap/phmap_base.h +++ b/parallel_hashmap/phmap_base.h @@ -5007,10 +5007,10 @@ public: { void lock() ABSL_EXCLUSIVE_LOCK_FUNCTION() { this->Lock(); } void unlock() ABSL_UNLOCK_FUNCTION() { this->Unlock(); } - void try_lock() ABSL_EXCLUSIVE_TRYLOCK_FUNCTION(true) { this->TryLock(); } + bool try_lock() ABSL_EXCLUSIVE_TRYLOCK_FUNCTION(true) { return this->TryLock(); } void lock_shared() ABSL_SHARED_LOCK_FUNCTION() { this->ReaderLock(); } void unlock_shared() ABSL_UNLOCK_FUNCTION() { this->ReaderUnlock(); } - void try_lock_shared() ABSL_SHARED_TRYLOCK_FUNCTION(true) { this->ReaderTryLock(); } + bool try_lock_shared() ABSL_SHARED_TRYLOCK_FUNCTION(true) { return this->ReaderTryLock(); } }; template <>