#ifndef _mutex_h #define _mutex_h #include // Start class mutex class Mutex { public: // Constructors Mutex(); ~Mutex(); // Custom constructor not provided for portability // There is not much you can customize anyway // Mutex(pthread_mutexattr_t attribute); // P() and V() return 0 on successful completion int P(void); // Lock a mutex int V(void); // Unlock the mutex private: pthread_mutex_t mutex_var; bool locked; }; // End class mutex #endif