With a cursory 30-second overview of the code (aka, it's highly likely I missed something), it looks like RawMutex simply encapsulates the WIN32/linux cross-platform differences, so I suspect that if you changed the class to use a member variable, that would be sufficient:

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

And then in lib/core/mutex.cpp:
Code:
RawMutex::RawMutex()
{
    pthread_mutexattr_t attr;

    pthread_mutexattr_init(&attr);
#ifdef __USE_UNIX98
    pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
#else
    pthread_mutexattr_setkind_np(&attr, PTHREAD_MUTEX_RECURSIVE_NP /*ERRORCHECK_NP*/);
#endif
    int i = pthread_mutex_init(&m, &attr);
    if (i)
    {
#if DEBUG>0
        WARN("Couldn't create mutex at %p.\n", &m);
#endif
        WARN("Result of creating mutex: %d\n", i);
        ASSERT(false);
    }
    pthread_mutexattr_destroy(&attr);
}


Edited by canuckInOR (15/11/2013 18:18)
Edit Reason: Add good old & on the m. pthread functions take pointers...