X-Git-Url: http://git.tdb.fi/?p=libs%2Fcore.git;a=blobdiff_plain;f=source%2Fcore%2Fsemaphore.h;h=1cf3cd6ad11b44402eacca11d415d9df60941916;hp=a7cdff7371d4f301468ff42da669cea6daa5db26;hb=fe77fc6b869a71bf94d501a0762579f4ddbc5094;hpb=ff52b5032a3f040de5d3a48f953f2943d7a223b3 diff --git a/source/core/semaphore.h b/source/core/semaphore.h index a7cdff7..1cf3cd6 100644 --- a/source/core/semaphore.h +++ b/source/core/semaphore.h @@ -1,5 +1,5 @@ /* -This file is part of libmspframework +This file is part of libmspcore Copyright © 2006 Mikko Rasa, Mikkosoft Productions Distributed under the LGPL */ @@ -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