LRT14  1.0
 All Classes Namespaces Functions Variables Enumerations Enumerator
lock_on.hpp
1 #ifndef RHESUS_LOCK_ON_H_
2 #define RHESUS_LOCK_ON_H_
3 
4 #include "SyncObject.h"
5 
6 namespace Rhesus
7 {
8 namespace Toolkit
9 {
10 namespace Tasks
11 {
12  class lock_on
13  {
14  public:
15  lock_on(SyncObject& syncObj)
16  : m_syncObj(syncObj)
17  {
18  m_syncObj.lock();
19  }
20 
21  ~lock_on()
22  {
23  m_syncObj.unlock();
24  }
25 
26  private:
27  SyncObject& m_syncObj;
28  };
29 }
30 }
31 }
32 
33 #endif