X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fcore%2Fsemaphore.h;h=b060947b57e0d0aaf661b9a04c1141f4c3f3d3dc;hb=7292f4413397b7f2e4689f7597f4b9e73435352e;hp=164131acaaa8c19d5f94b9139be12fe9e05117a6;hpb=c6e82eb96aba6354a35143ccae6f0ae87b4c1204;p=libs%2Fcore.git diff --git a/source/core/semaphore.h b/source/core/semaphore.h index 164131a..b060947 100644 --- a/source/core/semaphore.h +++ b/source/core/semaphore.h @@ -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 @@ -32,7 +31,9 @@ public: ~Semaphore() { CloseHandle(sem); } #endif private: +#ifndef WIN32 Mutex mutex; +#endif SemaphoreHandle sem; };