Fixed race condition when disconnecting shared memory client elements.
This commit is contained in:
parent
69bfb3a0be
commit
7e5d7264ae
1 changed files with 2 additions and 0 deletions
|
@ -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<sharedPage>::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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue