CMS 3D CMS Logo

CSCDQM_Lock.h
Go to the documentation of this file.
1 /*
2  * =====================================================================================
3  *
4  * Filename: CSCDQM_Lock.h
5  *
6  * Description: Lockable interface that blocks current thread.
7  *
8  * Version: 1.0
9  * Created: 10/06/2008 01:49:51 PM
10  * Revision: none
11  * Compiler: gcc
12  *
13  * Author: Valdas Rapsevicius, valdas.rapsevicius@cern.ch
14  * Company: CERN, CH
15  *
16  * =====================================================================================
17  */
18 
19 #ifndef CSCDQM_Lock_H
20 #define CSCDQM_Lock_H
21 
22 #ifdef DQMMT
23 #include <boost/thread.hpp>
24 #endif
25 
26 namespace cscdqm {
27 
28 #ifdef DQMMT
29  typedef boost::recursive_mutex::scoped_lock LockType;
30 #else
31  struct LockType {
32  bool locked;
33  LockType(bool locked_) : locked(locked_) {}
34  void unlock() { locked = false; }
35  };
36 #endif
37 
42  class Lock {
43  public:
45 #ifdef DQMMT
46  boost::recursive_mutex mutex;
47 #else
48  bool mutex = false;
49 #endif
50 
54  Lock() {}
55 
59  virtual ~Lock() {}
60  };
61 
62 } // namespace cscdqm
63 
64 #endif
cscdqm::LockType::locked
bool locked
Definition: CSCDQM_Lock.h:32
cscdqm::Lock::~Lock
virtual ~Lock()
Destructor.
Definition: CSCDQM_Lock.h:59
cscdqm::Lock
Lockable interface that blocks thread.
Definition: CSCDQM_Lock.h:42
cscdqm
Definition: CSCDQM_DCSBase.h:29
cscdqm::LockType
Definition: CSCDQM_Lock.h:31
cscdqm::LockType::LockType
LockType(bool locked_)
Definition: CSCDQM_Lock.h:33
cscdqm::Lock::mutex
bool mutex
Definition: CSCDQM_Lock.h:48
cscdqm::Lock::Lock
Lock()
Constructor.
Definition: CSCDQM_Lock.h:54
cscdqm::LockType::unlock
void unlock()
Definition: CSCDQM_Lock.h:34