/*
- * $Id$
- *
- * DEBUG: section 54 Interprocess Communication
+ * Copyright (C) 1996-2018 The Squid Software Foundation and contributors
*
+ * Squid software is distributed under GPLv2+ license and includes
+ * contributions from numerous individuals and organizations.
+ * Please see the COPYING and CONTRIBUTORS files for details.
*/
+/* DEBUG: section 54 Interprocess Communication */
+
#include "squid.h"
-#include "base/TextException.h"
#include "base/RunnersRegistry.h"
+#include "base/TextException.h"
#include "ipc/mem/PagePool.h"
#include "ipc/mem/Pages.h"
-#include "structs.h"
-#include "SwapDir.h"
+#include "tools.h"
// Uses a single PagePool instance, for now.
// Eventually, we may have pools dedicated to memory caching, disk I/O, etc.
public:
/* RegisteredRunner API */
SharedMemPagesRr(): owner(NULL) {}
- virtual void run(const RunnerRegistry &);
- virtual void create(const RunnerRegistry &);
- virtual void open(const RunnerRegistry &);
+ virtual void useConfig();
+ virtual void create();
+ virtual void open();
virtual ~SharedMemPagesRr();
private:
Ipc::Mem::PagePool::Owner *owner;
};
-RunnerRegistrationEntry(rrAfterConfig, SharedMemPagesRr);
-
+RunnerRegistrationEntry(SharedMemPagesRr);
void
-SharedMemPagesRr::run(const RunnerRegistry &r)
+SharedMemPagesRr::useConfig()
{
if (Ipc::Mem::PageLimit() <= 0)
return;
- Ipc::Mem::RegisteredRunner::run(r);
+ Ipc::Mem::RegisteredRunner::useConfig();
}
void
-SharedMemPagesRr::create(const RunnerRegistry &)
+SharedMemPagesRr::create()
{
Must(!owner);
owner = Ipc::Mem::PagePool::Init(PagePoolId, Ipc::Mem::PageLimit(),
}
void
-SharedMemPagesRr::open(const RunnerRegistry &)
+SharedMemPagesRr::open()
{
Must(!ThePagePool);
ThePagePool = new Ipc::Mem::PagePool(PagePoolId);
SharedMemPagesRr::~SharedMemPagesRr()
{
- if (!UsingSmp())
- return;
-
delete ThePagePool;
ThePagePool = NULL;
delete owner;
}
+