Fixed potential deadlock in buffer when a past crash has happened

This commit is contained in:
Thulinma 2016-07-28 20:41:44 +02:00
parent 0232417512
commit 4dc3d22d12

View file

@ -766,6 +766,10 @@ namespace IPC {
DEBUG_MSG(DLVL_FAIL, "Creating semaphore failed: %s", strerror(errno)); DEBUG_MSG(DLVL_FAIL, "Creating semaphore failed: %s", strerror(errno));
return; return;
} }
if (!mySemaphore.tryWaitOneSecond()){
WARN_MSG("Force unlocking sharedServer semaphore to prevent deadlock");
}
mySemaphore.post();
semGuard tmpGuard(&mySemaphore); semGuard tmpGuard(&mySemaphore);
newPage(); newPage();
} }