1 #ifndef ARTDAQ_CORE_UTILITIES_TRACELOCK
2 #define ARTDAQ_CORE_UTILITIES_TRACELOCK_HH 1
18 TraceLock(std::mutex& mutex,
int level, std::string description);
26 std::unique_lock<std::mutex> lock_;
27 std::string description_;
33 , description_(description)
36 TLOG_ARB(level_,
"TraceLock") <<
"Acquired Lock " << description_ <<
", mutex=" << (
void*)&mutex <<
", lock=" << (
void*)&lock_ ;
40 TLOG_ARB(level_,
"TraceLock") <<
"Releasing lock " << description_ <<
", lock=" << (
void*)&lock_ ;
TraceLock(std::mutex &mutex, int level, std::string description)
Construct a TraceLock.
The TraceLock class allows a user to debug the acquisition and releasing of locks, by wrapping the unique_lock<std::mutex> API with TRACE calls.
virtual ~TraceLock()
Release the TraceLock.