Copyright © 2006 Mikko Rasa, Mikkosoft Productions
Distributed under the LGPL
*/
+
#ifndef MSP_CORE_SEMAPHORE_H_
#define MSP_CORE_SEMAPHORE_H_
class Semaphore
{
-public:
- Semaphore();
- Semaphore(Mutex &);
- int signal();
- int broadcast();
- int wait();
- int wait(const Time::TimeDelta &);
- Mutex &get_mutex() { return *mutex; }
- ~Semaphore();
private:
Mutex *mutex;
bool own_mutex;
unsigned count;
#endif
+public:
+ Semaphore();
+ Semaphore(Mutex &);
+private:
void init();
+public:
+ ~Semaphore();
+
+ int signal();
+ int broadcast();
+ int wait();
+ int wait(const Time::TimeDelta &);
+ Mutex &get_mutex() { return *mutex; }
};
#ifndef WIN32