Make MutexLock noncopyable
~MutexLock() { mutex.unlock(); }
private:
Mutex &mutex;
+
+ MutexLock(const MutexLock &);
+ MutexLock &operator=(const MutexLock &);
};
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