/*
- * $Id$
- *
- * DEBUG: section 54 Interprocess Communication
+ * Copyright (C) 1996-2015 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.
*/
-#include "config.h"
+/* DEBUG: section 54 Interprocess Communication */
+
+#include "squid.h"
+#include "base/TextException.h"
+#include "globals.h"
#include "ipc/Kids.h"
-#include "protos.h"
+#include "SquidConfig.h"
+#include "tools.h"
Kids TheKids;
KidName TheKidName;
/// maintain n kids
void Kids::init()
{
- if (storage.size() > 0)
- storage.clean();
+ storage.clear();
storage.reserve(NumberOfKids());
}
// add Kid records for all disk processes
- // (XXX: some cache_dirs do not need this)
- for (int i = 0; i < Config.cacheSwap.n_configured; ++i) {
+ for (int i = 0; i < Config.cacheSwap.n_strands; ++i) {
snprintf(kid_name, sizeof(kid_name), "(squid-disk-%d)", (int)(storage.size()+1));
storage.push_back(Kid(kid_name));
}
snprintf(kid_name, sizeof(kid_name), "(squid-coord-%d)", (int)(storage.size()+1));
storage.push_back(Kid(kid_name));
}
+
+ Must(storage.size() == static_cast<size_t>(NumberOfKids()));
}
/// returns kid by pid
{
return storage.size();
}
+