From: Amos Jeffries Date: Tue, 2 Jun 2015 10:04:27 +0000 (-0700) Subject: Convert ReadWriteLock to std::atomic X-Git-Tag: merge-candidate-3-v1~72^2~5 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=77c9f409cd82b4dd3aa555718ea839130011b00c;p=thirdparty%2Fsquid.git Convert ReadWriteLock to std::atomic --- diff --git a/src/ipc/MemMap.h b/src/ipc/MemMap.h index 170df34a16..d31179e542 100644 --- a/src/ipc/MemMap.h +++ b/src/ipc/MemMap.h @@ -10,6 +10,7 @@ #define SQUID_IPC_STORE_MAP_H #include "Debug.h" +#include "ipc/AtomicWord.h" #include "ipc/mem/FlexibleArray.h" #include "ipc/mem/Pointer.h" #include "ipc/ReadWriteLock.h" diff --git a/src/ipc/ReadWriteLock.h b/src/ipc/ReadWriteLock.h index 65ec41b586..511a29eb9d 100644 --- a/src/ipc/ReadWriteLock.h +++ b/src/ipc/ReadWriteLock.h @@ -9,7 +9,7 @@ #ifndef SQUID_IPC_READ_WRITE_LOCK_H #define SQUID_IPC_READ_WRITE_LOCK_H -#include "ipc/AtomicWord.h" +#include class StoreEntry; @@ -39,13 +39,13 @@ public: void updateStats(ReadWriteLockStats &stats) const; public: - mutable Atomic::Word readers; ///< number of reading users - Atomic::Word writing; ///< there is a writing user (there can be at most 1) - Atomic::Word appending; ///< the writer has promissed to only append + mutable std::atomic readers; ///< number of reading users + std::atomic writing; ///< there is a writing user (there can be at most 1) + std::atomic appending; ///< the writer has promissed to only append private: - mutable Atomic::Word readLevel; ///< number of users reading (or trying to) - Atomic::Word writeLevel; ///< number of users writing (or trying to write) + mutable std::atomic readLevel; ///< number of users reading (or trying to) + std::atomic writeLevel; ///< number of users writing (or trying to write) }; /// approximate stats of a set of ReadWriteLocks diff --git a/src/ipc/StoreMap.h b/src/ipc/StoreMap.h index feaafe60dc..b523e065ba 100644 --- a/src/ipc/StoreMap.h +++ b/src/ipc/StoreMap.h @@ -9,6 +9,7 @@ #ifndef SQUID_IPC_STORE_MAP_H #define SQUID_IPC_STORE_MAP_H +#include "ipc/AtomicWord.h" #include "ipc/mem/FlexibleArray.h" #include "ipc/mem/Pointer.h" #include "ipc/ReadWriteLock.h"