Fixed semaphore problems on MacOS

This commit is contained in:
Thulinma 2019-05-13 14:12:13 +02:00
parent 035496d198
commit 4c324c1b19
3 changed files with 11 additions and 3 deletions

View file

@ -121,6 +121,14 @@ namespace IPC {
#else
if (oflag & O_CREAT) {
mySem = sem_open(name, oflag, mode, value);
#if defined(__APPLE__)
if (!(*this)){
if (sem_unlink(name) == 0){
INFO_MSG("Deleted in-use semaphore: %s", name);
mySem = sem_open(name, oflag, mode, value);
}
}
#endif
} else {
mySem = sem_open(name, oflag);
}