Merge branch 'development' into LTS_development

This commit is contained in:
Thulinma 2019-01-09 09:29:26 +01:00
commit 5c074757f1

View file

@ -449,7 +449,7 @@ namespace IPC {
handle = shm_open(name.c_str(), (master ? O_CREAT | O_EXCL : 0) | O_RDWR, ACCESSPERMS); handle = shm_open(name.c_str(), (master ? O_CREAT | O_EXCL : 0) | O_RDWR, ACCESSPERMS);
if (handle == -1) { if (handle == -1) {
if (master) { if (master) {
ERROR_MSG("Overwriting old page for %s", name.c_str()); if (len > 1){ERROR_MSG("Overwriting old page for %s", name.c_str());}
handle = shm_open(name.c_str(), O_CREAT | O_RDWR, ACCESSPERMS); handle = shm_open(name.c_str(), O_CREAT | O_RDWR, ACCESSPERMS);
} else { } else {
int i = 0; int i = 0;
@ -1007,8 +1007,10 @@ namespace IPC {
amount = lastFilled+1; amount = lastFilled+1;
VERYHIGH_MSG("Shared memory %s is now at count %u", baseName.c_str(), amount); VERYHIGH_MSG("Shared memory %s is now at count %u", baseName.c_str(), amount);
} }
//stop, we're guaranteed no more pages are full at this point if (id >= amount + 100) {
break; //stop, we're guaranteed no more pages are full at this point
break;
}
} }
} }
} else { } else {
@ -1029,11 +1031,13 @@ namespace IPC {
amount = lastFilled+1; amount = lastFilled+1;
VERYHIGH_MSG("Shared memory %s is now at count %u", baseName.c_str(), amount); VERYHIGH_MSG("Shared memory %s is now at count %u", baseName.c_str(), amount);
} }
//stop, we're guaranteed no more pages are full at this point if (id >= amount + 100) {
if (empty) { //stop, we're guaranteed no more pages are full at this point
free(empty); if (empty) {
free(empty);
}
break;
} }
break;
} }
} }
} }