]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Refactor Ipc::Mem::PagePool using std::atomic
authorAmos Jeffries <squid3@treenet.co.nz>
Tue, 2 Jun 2015 09:14:22 +0000 (02:14 -0700)
committerAmos Jeffries <squid3@treenet.co.nz>
Tue, 2 Jun 2015 09:14:22 +0000 (02:14 -0700)
src/ipc/mem/PagePool.cc
src/ipc/mem/PagePool.h

index 7753d37bee7cbfe0e6c6802ea0018667f84dcbac..442b793ea56707d2176552d84f9143224f704dd8 100644 (file)
@@ -26,7 +26,7 @@ Ipc::Mem::PagePool::Init(const char *const id, const unsigned int capacity, cons
 
 Ipc::Mem::PagePool::PagePool(const char *const id):
     pageIndex(shm_old(PageStack)(id)),
-    theLevels(reinterpret_cast<Atomic::Word *>(
+    theLevels(reinterpret_cast<Levels_t *>(
                   reinterpret_cast<char *>(pageIndex.getRaw()) +
                   pageIndex->stackSize())),
     theBuf(reinterpret_cast<char *>(theLevels + PageId::maxPurpose))
index 9622574fd02a4a491cb54f1ba3503c686872fd20..5c32b3e46c1f99236bbae3a9011f51a611b34ae0 100644 (file)
@@ -9,7 +9,6 @@
 #ifndef SQUID_IPC_MEM_PAGE_POOL_H
 #define SQUID_IPC_MEM_PAGE_POOL_H
 
-#include "ipc/AtomicWord.h"
 #include "ipc/mem/Page.h"
 #include "ipc/mem/PageStack.h"
 #include "ipc/mem/Pointer.h"
@@ -50,8 +49,9 @@ public:
 
 private:
     Ipc::Mem::Pointer<PageStack> pageIndex; ///< free pages index
+    typedef std::atomic<size_t> Levels_t;
     /// number of shared memory pages used now for each purpose
-    Atomic::Word *const theLevels;
+    Levels_t * const theLevels;
     char *const theBuf; ///< pages storage
 };