DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
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
10namespace uhallibs {
11namespace ipc {
12
13namespace exception {
15UHAL_DEFINE_DERIVED_EXCEPTION_CLASS(
16 MutexError, uhal::exception::TransportLayerError,
17 "Exception class to handle errors from pthread mutex-related functions.")
18} // namespace exception
19
21 public:
24
25 void lock();
26
27 void unlock();
28
29 uint64_t getCounter() const;
30
31 bool isActive() const;
32
33 void startSession();
34
35 void endSession();
36
37 private:
39
40 pthread_mutex_t mMutex;
41 uint64_t mCount;
43};
44
45} // namespace ipc
46} // namespace uhal
47
48#endif /* _uhal_ipc_RobustMutex_hpp_ */
uint64_t getCounter() const
RobustMutex(const RobustMutex &)
caught dunedaq::conffwk::Exception exception