Definition at line 26 of file MMutex.h.
◆ MMutex() [1/3]
◆ MMutex() [2/3]
Definition at line 19 of file MMutex.cc.
20{
21 set((pthread_mutex_t*)addr);
22}
◆ MMutex() [3/3]
Definition at line 14 of file MMutex.cc.
15{
16 *this = mutex;
17}
◆ ~MMutex()
◆ destroy()
Definition at line 75 of file MMutex.cc.
76{
77 if (pthread_mutex_destroy(m_mu) != 0) {
78 return true;
79 } else {
80 return false;
81 }
82}
◆ init() [1/2]
Definition at line 33 of file MMutex.cc.
34{
35 pthread_mutexattr_t attr;
36 pthread_mutexattr_init(&attr);
37 pthread_mutexattr_setpshared(&attr, PTHREAD_PROCESS_SHARED);
38 pthread_mutex_init(m_mu, &attr);
39 pthread_mutexattr_destroy(&attr);
40 return true;
41}
◆ init() [2/2]
Definition at line 26 of file MMutex.cc.
27{
28 set(addr);
29 init();
30 return true;
31}
◆ lock()
Definition at line 49 of file MMutex.cc.
50{
51 if (pthread_mutex_lock(m_mu) != 0) {
52 return false;
53 } else {
54 return true;
55 }
56}
◆ operator=()
Definition at line 84 of file MMutex.cc.
85{
86 m_mu = mutex.m_mu;
87 return *this;
88}
◆ set()
Definition at line 43 of file MMutex.cc.
44{
45 m_mu = (pthread_mutex_t*)addr;
46 return true;
47}
◆ size()
Definition at line 31 of file MMutex.h.
31{ return sizeof(pthread_mutex_t); }
◆ trylock()
Definition at line 58 of file MMutex.cc.
59{
60 if (pthread_mutex_lock(m_mu) != 0) {
61 return false;
62 }
63 return true;
64}
◆ unlock()
Definition at line 66 of file MMutex.cc.
67{
68 if (pthread_mutex_unlock(m_mu) != 0) {
69 return true;
70 } else {
71 return false;
72 }
73}
◆ MCond
◆ m_mu
The documentation for this class was generated from the following files: