39 pthread_mutexattr_t mutexAttrs;
40 pthread_mutexattr_init(&mutexAttrs);
41 pthread_mutexattr_settype(&mutexAttrs, PTHREAD_MUTEX_RECURSIVE);
42 int res = pthread_mutex_init(&this->
mutex, &mutexAttrs);
44 pthread_mutexattr_destroy(&mutexAttrs);
53 int res = pthread_mutex_destroy(&this->
mutex);
63 pthread_mutex_lock(&this->
mutex);
72 pthread_mutex_unlock(&this->
mutex);
On OSX, pthread mutexes are used for critical sections.
Definition osxcriticalsection.h:19
pthread_mutex_t mutex
Definition osxcriticalsection.h:30
void Leave() const
leave the critical section
Definition osxcriticalsection.h:70
~OSXCriticalSection()
destructor
Definition osxcriticalsection.h:51
void Enter() const
enter the critical section
Definition osxcriticalsection.h:61
OSXCriticalSection()
constructor
Definition osxcriticalsection.h:37
#define n_assert(exp)
Definition debug.h:50
Definition osxsysfunc.h:21