test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 
44  public:
45 
47 #ifdef DQMMT
48  boost::recursive_mutex mutex;
49 #else
50  bool mutex;
51 #endif
52 
56  Lock() { }
57 
61  virtual ~Lock() { }
62 
63  };
64 
65 }
66 
67 #endif
Lock()
Constructor.
Definition: CSCDQM_Lock.h:56
LockType(bool locked_)
Definition: CSCDQM_Lock.h:33
virtual ~Lock()
Destructor.
Definition: CSCDQM_Lock.h:61
Lockable interface that blocks thread.
Definition: CSCDQM_Lock.h:42