mirror of
https://github.com/greg7mdp/parallel-hashmap.git
synced 2026-08-30 00:50:38 +08:00
Fix clang "thread-safety-analysis" warnings - issue #196
This commit is contained in:
Vendored
+6
-22
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user