diff --git a/lib/shared_memory.cpp b/lib/shared_memory.cpp index 85dd0d16..a436df59 100644 --- a/lib/shared_memory.cpp +++ b/lib/shared_memory.cpp @@ -718,6 +718,7 @@ namespace IPC { empty = (char *)malloc(payLen * sizeof(char)); memset(empty, 0, payLen); } + semGuard tmpGuard(&mySemaphore); unsigned int id = 0; for (std::set::iterator it = myPages.begin(); it != myPages.end(); it++) { if (!it->mapped || !it->len) { @@ -915,6 +916,7 @@ namespace IPC { return; } if (myPage.mapped) { + semGuard tmpGuard(&mySemaphore); myPage.mapped[offsetOnPage] = 127; } }