27 #ifndef _MUTEX_POSIX_HPP
28 #define _MUTEX_POSIX_HPP
63 int result = pthread_mutexattr_init(&
_attr);
69 result = pthread_mutexattr_settype(&
_attr, PTHREAD_MUTEX_RECURSIVE);
72 os::abort_errnum(result,
"Mutex::Mutex(): pthread_mutexattr_settype failed");
88 int result = pthread_mutexattr_destroy(&
_attr);
91 os::abort_errnum(result,
"Mutex::~Mutex(): pthread_mutexattr_destroy failed");
94 result = pthread_mutex_destroy(&
_mutex);
113 int result = pthread_mutex_lock(&
_mutex);
127 int result = pthread_mutex_unlock(&
_mutex);
Mutex()
Initializes the given mutex object and checks for errors.
Dummy implementation of a mutex.
pthread_mutexattr_t _attr
static void abort_errnum(int errnum, const char *text,...)
Prints an error message, appends ":" plus the strerror-message of errnum and aborts the VM...
~Mutex()
Destroys the given mutex object and checks for errors.
Dummy condition variable.
void unlock()
Unlocks the given mutex object and checks for errors.
void lock()
Locks the given mutex object and checks for errors.