DUNE-DAQ
DUNE Trigger and Data Acquisition software
Toggle main menu visibility
Loading...
Searching...
No Matches
dunedaq
sourcecode
uhallibs
include
uhallibs
ipc
RobustMutex.hpp
Go to the documentation of this file.
1
2
#ifndef _uhal_ipc_RobustMutex_hpp_
3
#define _uhal_ipc_RobustMutex_hpp_
4
5
#include <cstdint>
6
7
#include "uhal/ClientInterface.hpp"
8
#include "uhal/log/exception.hpp"
9
10
namespace
uhallibs
{
11
namespace
ipc
{
12
13
namespace
exception
{
15
UHAL_DEFINE_DERIVED_EXCEPTION_CLASS(MutexError,
16
uhal::exception::TransportLayerError,
17
"Exception class to handle errors from pthread mutex-related functions."
)
18
}
// namespace exception
19
20
class
RobustMutex
21
{
22
public
:
23
RobustMutex
();
24
~RobustMutex
();
25
26
void
lock
();
27
28
void
unlock
();
29
30
uint64_t
getCounter
()
const
;
31
32
bool
isActive
()
const
;
33
34
void
startSession
();
35
36
void
endSession
();
37
38
private
:
39
RobustMutex
(
const
RobustMutex
&);
40
41
pthread_mutex_t
mMutex
;
42
uint64_t
mCount
;
43
bool
mSessionActive
;
44
};
45
46
}
// namespace ipc
47
}
// namespace uhal
48
49
#endif
/* _uhal_ipc_RobustMutex_hpp_ */
uhallibs::ipc::RobustMutex::lock
void lock()
Definition
RobustMutex.cpp:47
uhallibs::ipc::RobustMutex::getCounter
uint64_t getCounter() const
Definition
RobustMutex.cpp:76
uhallibs::ipc::RobustMutex::RobustMutex
RobustMutex()
Definition
RobustMutex.cpp:9
uhallibs::ipc::RobustMutex::isActive
bool isActive() const
Definition
RobustMutex.cpp:82
uhallibs::ipc::RobustMutex::startSession
void startSession()
Definition
RobustMutex.cpp:88
uhallibs::ipc::RobustMutex::unlock
void unlock()
Definition
RobustMutex.cpp:68
uhallibs::ipc::RobustMutex::mSessionActive
bool mSessionActive
Definition
RobustMutex.hpp:43
uhallibs::ipc::RobustMutex::RobustMutex
RobustMutex(const RobustMutex &)
uhallibs::ipc::RobustMutex::mCount
uint64_t mCount
Definition
RobustMutex.hpp:42
uhallibs::ipc::RobustMutex::mMutex
pthread_mutex_t mMutex
Definition
RobustMutex.hpp:41
uhallibs::ipc::RobustMutex::endSession
void endSession()
Definition
RobustMutex.cpp:95
uhallibs::ipc::exception
Definition
RobustMutex.hpp:13
uhallibs::ipc
Definition
RobustMutex.hpp:11
uhallibs
Definition
formatters.hpp:9
Generated on
for DUNE-DAQ by
1.18.0