EPICS ARCHIVER V4
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups
OrderedMutex.h
1 
2 #ifndef __ORDEREDMUTEX_H__
3 #define __ORDEREDMUTEX_H__
4 
5 // epics
6 #include <epicsMutex.h>
7 
8 // tools
9 #include "tools/GenericException.h"
10 #include "tools/ToolsConfig.h"
11 #include "tools/NoCopy.h"
12 
35 {
36 public:
38  static const size_t Throttle = 101;
39 
41  static const size_t ConcurrentList = 100;
42 
44  OrderedMutex(const char *name, size_t order);
45 
47  ~OrderedMutex();
48 
50  const stdString &getName() const
51  { return name; }
52 
54  size_t getOrder() const
55  { return order; }
56 
65  void lock(const char *file, size_t line);
66 
68  void unlock();
69 
70 private:
71  PROHIBIT_DEFAULT_COPY(OrderedMutex);
72  stdString name;
73  size_t order;
74  epicsMutexId mutex;
75 };
76 
77 // Dumps the current lock list.
78 extern void LockMonitorDump();
79 
80 #endif
81 
size_t getOrder() const
Definition: OrderedMutex.h:54
OrderedMutex(const char *name, size_t order)
Create mutex with name and lock order.
A mutex with informational name and lock order.
Definition: OrderedMutex.h:34
const stdString & getName() const
Definition: OrderedMutex.h:50
void unlock()
Unlock the mutex.
~OrderedMutex()
Destructor.
Timer for throttling messages, thread safe.
Definition: Throttle.h:19
Type-save wrapper for ConcurrentPtrList.
Definition: ConcurrentList.h:135
void lock(const char *file, size_t line)
Lock the mutex.