dius 0.1.0
Loading...
Searching...
No Matches
mutex.h
Go to the documentation of this file.
1#pragma once
2
3#include <pthread.h>
4
5namespace dius {
6class Mutex {
7public:
9 Mutex(Mutex const&) = delete;
10
12
13 void operator=(Mutex const&) = delete;
14
15 void lock();
16
17 auto try_lock() -> bool;
18
19 void unlock();
20
21 auto native_handle() -> pthread_mutex_t* { return &m_mutex; }
22
23private:
24 pthread_mutex_t m_mutex;
25};
26}
auto try_lock() -> bool
auto native_handle() -> pthread_mutex_t *
Definition mutex.h:21
void unlock()
Mutex(Mutex const &)=delete
void operator=(Mutex const &)=delete
Definition directory_entry.h:11