]> git.tdb.fi Git - libs/core.git/blobdiff - source/core/semaphore.h
Add a missing mutex unlock into Semaphore::wait
[libs/core.git] / source / core / semaphore.h
index a7cdff7371d4f301468ff42da669cea6daa5db26..b060947b57e0d0aaf661b9a04c1141f4c3f3d3dc 100644 (file)
@@ -17,10 +17,9 @@ class Semaphore
 public:
 #ifndef WIN32
        Semaphore()        { pthread_cond_init(&sem, 0); }
-       //Mutex &get_mutex() { return mutex; }
        int   signal()     { MutexLock l(mutex); return pthread_cond_signal(&sem); }
        int   broadcast()  { MutexLock l(mutex); return pthread_cond_broadcast(&sem); }
-       int   wait()       { mutex.lock(); return pthread_cond_wait(&sem, &mutex.mutex); }
+       int   wait()       { MutexLock l(mutex); return pthread_cond_wait(&sem, &mutex.mutex); }
        int   wait(const Time::TimeDelta &);
        ~Semaphore()       { pthread_cond_destroy(&sem); }
 #else