semaphore bugfix!

This commit is contained in:
ozzay 2014-12-23 12:40:03 +01:00 committed by Thulinma
parent 4d9f4da3f1
commit bca9546d6d
2 changed files with 4 additions and 5 deletions

View file

@ -56,7 +56,6 @@ namespace IPC {
#else
mySem = SEM_FAILED;
#endif
myName = 0;
}
///\brief Constructs a named semaphore
@ -177,11 +176,11 @@ namespace IPC {
void semaphore::unlink() {
close();
#ifndef __CYGWIN__
if (myName) {
sem_unlink(myName);
if (myName.size()) {
sem_unlink(myName.c_str());
}
#endif
myName = 0;
myName.clear();
}

View file

@ -70,7 +70,7 @@ namespace IPC {
#else
sem_t * mySem;
#endif
char * myName;
std::string myName;
};
///\brief A class used as a semaphore guard