Fix clang "thread-safety-analysis" warnings - issue #196

This commit is contained in:
greg7mdp
2023-06-11 10:02:00 -04:00
parent a4ae6cc1be
commit 714d70b6ca
2 changed files with 7 additions and 23 deletions
+6 -22
View File
@@ -4869,12 +4869,12 @@ public:
struct AbslMutex : protected absl::Mutex
{
void lock() { this->Lock(); }
void unlock() { this->Unlock(); }
void try_lock() { this->TryLock(); }
void lock_shared() { this->ReaderLock(); }
void unlock_shared() { this->ReaderUnlock(); }
void try_lock_shared() { this->ReaderTryLock(); }
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(); }
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(); }
};
template <>
@@ -4898,7 +4898,6 @@ public:
// --------------------------------------------------------------------------
#ifdef BOOST_THREAD_SHARED_MUTEX_HPP
#if 1
// ---------------------------------------------------------------------------
template <>
class LockableImpl<boost::shared_mutex> : public boost::shared_mutex
@@ -4913,21 +4912,6 @@ public:
using UniqueLocks = typename Base::WriteLocks;
using UpgradeToUnique = typename Base::DoNothing; // we already have unique ownership
};
#else
// ---------------------------------------------------------------------------
template <>
class LockableImpl<boost::upgrade_mutex> : public boost::upgrade_mutex
{
public:
using mutex_type = boost::upgrade_mutex;
using SharedLock = boost::shared_lock<mutex_type>;
using UpgradeLock = boost::upgrade_lock<mutex_type>;
using UniqueLock = boost::unique_lock<mutex_type>;
using SharedLocks = typename Base::ReadLocks;
using UniqueLocks = typename Base::WriteLocks;
using UpgradeToUnique = boost::upgrade_to_unique_lock<mutex_type>;
};
#endif
#endif // BOOST_THREAD_SHARED_MUTEX_HPP