5
* Copyright (C) 2010 DeNA Co.,Ltd.. All rights reserved.
6
* See COPYRIGHT.txt for details.
10
#define DENA_MUTEX_HPP
22
struct mutex : private noncopyable {
23
friend struct condition;
25
if (pthread_mutex_init(&mtx, 0) != 0) {
26
fatal_abort("pthread_mutex_init");
30
if (pthread_mutex_destroy(&mtx) != 0) {
31
fatal_abort("pthread_mutex_destroy");
35
if (pthread_mutex_lock(&mtx) != 0) {
36
fatal_abort("pthread_mutex_lock");
40
if (pthread_mutex_unlock(&mtx) != 0) {
41
fatal_abort("pthread_mutex_unlock");
45
mutable pthread_mutex_t mtx;