Fixed statistics recovery after controller reload/restart
This commit is contained in:
parent
c6377085f0
commit
88834e53ba
1 changed files with 12 additions and 8 deletions
|
@ -807,11 +807,15 @@ namespace IPC {
|
||||||
|
|
||||||
///\brief Creates the next page with the correct size
|
///\brief Creates the next page with the correct size
|
||||||
void sharedServer::newPage() {
|
void sharedServer::newPage() {
|
||||||
sharedPage tmp(std::string(baseName.substr(1) + (char)(myPages.size() + (int)'A')), std::min(((8192 * 2) << myPages.size()), (32 * 1024 * 1024)), true);
|
sharedPage tmp(std::string(baseName.substr(1) + (char)(myPages.size() + (int)'A')), std::min(((8192 * 2) << myPages.size()), (32 * 1024 * 1024)), false);
|
||||||
myPages.push_back(tmp);
|
if (!tmp.mapped){
|
||||||
|
tmp.init(std::string(baseName.substr(1) + (char)(myPages.size() + (int)'A')), std::min(((8192 * 2) << myPages.size()), (32 * 1024 * 1024)), true);
|
||||||
tmp.master = false;
|
tmp.master = false;
|
||||||
DEBUG_MSG(DLVL_VERYHIGH, "Created a new page: %s", tmp.name.c_str());
|
}
|
||||||
amount += tmp.len / (payLen + (hasCounter ? 1 : 0)) - 1;
|
myPages.push_back(tmp);
|
||||||
|
myPages.back().master = true;
|
||||||
|
VERYHIGH_MSG("Created a new page: %s", tmp.name.c_str());
|
||||||
|
amount += (32 * 1024 * 1024)*myPages.size();//assume maximum load - we don't want to miss any entries
|
||||||
}
|
}
|
||||||
|
|
||||||
///\brief Deletes the highest allocated page
|
///\brief Deletes the highest allocated page
|
||||||
|
@ -982,12 +986,12 @@ namespace IPC {
|
||||||
if (countNum == 127 || countNum == 126){
|
if (countNum == 127 || countNum == 126){
|
||||||
semGuard tmpGuard(&mySemaphore);
|
semGuard tmpGuard(&mySemaphore);
|
||||||
if (disconCallback){
|
if (disconCallback){
|
||||||
disconCallback(it->mapped + offset + 1, payLen, id);
|
disconCallback(counter + 1, payLen, id);
|
||||||
}
|
}
|
||||||
memset(it->mapped + offset + 1, 0, payLen);
|
memset(counter + 1, 0, payLen);
|
||||||
it->mapped[offset] = 0;
|
*counter = 0;
|
||||||
} else {
|
} else {
|
||||||
it->mapped[offset] ++;
|
++(*counter);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
//stop if we're past the amount counted and we're empty
|
//stop if we're past the amount counted and we're empty
|
||||||
|
|
Loading…
Add table
Reference in a new issue