RSS Git Download  Clone
Raw Blame History
/*******************************************************************************
 *	BMutex.h		BMutex Classes
 *			T.Barnaby,	BEAM Ltd,	1/11/02
 *******************************************************************************
 */
#ifndef BMUTEX_H
#define BMUTEX_H	1

#include <pthread.h>

/// Mutex class
class BMutex {
public:
			BMutex();
			BMutex(const BMutex& mutex);
			~BMutex();
	
	int		lock();			///< Set lock, wait in necessary
	int		unlock();		///< Unlock the lock
	int		tryLock();		///< Test the lock
	
	BMutex&		operator=(const BMutex& mutex);
private:
	pthread_mutex_t	omutex;
};

#endif