1 #ifndef EUDAQ_INCLUDED_Guard
2 #define EUDAQ_INCLUDED_Guard
6 #include "eudaq/Exception.hh"
14 pthread_mutex_init(&m_mutex, 0);
18 int err = pthread_mutex_lock(&m_mutex);
20 EUDAQ_THROW(
"Error " +
to_string(err) +
" locking mutex");
23 int err = pthread_mutex_unlock(&m_mutex);
25 EUDAQ_THROW(
"Error " +
to_string(err) +
" unlocking mutex");
40 virtual ~
Access() { Release(); }
48 pthread_mutex_t m_mutex;
53 Guarded(
const T &val) : m_var(val) {}
58 operator T &() {
return m_var; }
59 operator const T &()
const {
return m_var; }
84 #endif // EUDAQ_INCLUDED_Guard
std::string to_string(const T &x, int digits=0)
Definition: Utils.hh:54