2#ifndef THREADING_POSIXCRITICALSECTION_H
3#define THREADING_POSIXCRITICALSECTION_H
47 this->
mutex =
new pthread_mutex_t;
48 pthread_mutexattr_t attr;
49 pthread_mutexattr_init(&attr);
50 pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
51 pthread_mutex_init(this->
mutex, &attr);
52 pthread_mutexattr_destroy(&attr);
61 pthread_mutex_destroy(this->
mutex);
74 pthread_mutex_destroy(this->
mutex);
77 this->
mutex = rhs.mutex;
88 pthread_mutex_lock(this->
mutex);
98 pthread_mutex_unlock(this->
mutex);
Posix-implementation of critical section.
Definition posixcriticalsection.h:24
PosixCriticalSection()
constructor
Definition posixcriticalsection.h:44
void Leave() const
leave the critical section
Definition posixcriticalsection.h:96
pthread_mutex_t * mutex
Definition posixcriticalsection.h:37
void Enter() const
enter the critical section
Definition posixcriticalsection.h:86
void operator=(PosixCriticalSection &&rhs)
copy assignment
Definition posixcriticalsection.h:70
~PosixCriticalSection()
destructor
Definition posixcriticalsection.h:59
Posix implemention of a read-many write-few lock.
Definition posixsysfunc.cc:21