/* ******************************************************************* * * * Class Name: Thread * * Author: Arash Partow * * * ******************************************************************* */ #ifndef INCLUDE_MUTEX_H #define INCLUDE_MUTEX_H #include #include #include #include #include #include #include "StringTokenizer.h" #include #include class Mutex { public: class Exception : public std::exception { }; Mutex(void) throw(Exception); ~Mutex(void); void lock(void) throw(Exception); void unlock(void) throw(Exception); void tryLock(void) throw(Exception); pthread_t getCurrent(void) const; pthread_mutex_t& getMutex(); private: pthread_mutex_t mutex; pthread_t tid; }; #endif