Fixed semaphore problems on MacOS
This commit is contained in:
parent
035496d198
commit
4c324c1b19
3 changed files with 11 additions and 3 deletions
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue