Originally Posted By: mlord
#include <pthread.h> ?


I thought the same thing. I added a declaration of pthread_mutex_t test_me; and test_me works fine, but the RawMutex class does not.

Code:
pthread_mutex_t test_me;

class RawMutex : public pthread_mutex_t
{
 public:
    RawMutex();    // a bit too complex to inline
    ~RawMutex()    { pthread_mutex_destroy(this); }
    void Lock()    { pthread_mutex_lock(this); }
    void Unlock()  { pthread_mutex_unlock(this); }
    bool TryLock() { return pthread_mutex_trylock(this) == 0; }
};