8#include "daq/slc/system/MMutex.h"
14MMutex::MMutex(
const MMutex& mutex)
19MMutex::MMutex(
void* addr)
21 set((pthread_mutex_t*)addr);
26bool MMutex::init(
void* addr)
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);
43bool MMutex::set(
void* addr)
45 m_mu = (pthread_mutex_t*)addr;
51 if (pthread_mutex_lock(m_mu) != 0) {
60 if (pthread_mutex_lock(m_mu) != 0) {
68 if (pthread_mutex_unlock(m_mu) != 0) {
77 if (pthread_mutex_destroy(m_mu) != 0) {
Abstract base class for different kinds of events.