3 This file is part of libmspcore
4 Copyright © 2006 Mikko Rasa, Mikkosoft Productions
5 Distributed under the LGPL
8 #ifndef MSP_CORE_SEMAPHORE_H_
9 #define MSP_CORE_SEMAPHORE_H_
13 #include "../time/timedelta.h"
38 int wait(const Time::TimeDelta &);
39 Mutex &get_mutex() { return *mutex; }
43 inline int Semaphore::signal()
44 { return pthread_cond_signal(&sem); }
46 inline int Semaphore::broadcast()
47 { return pthread_cond_broadcast(&sem); }
49 inline int Semaphore::wait()
50 { return pthread_cond_wait(&sem, &mutex->mutex); }