LuaStateHandle.cpp
Go to the documentation of this file.
1 #include "LuaStateHandle.hpp"
2 
3 namespace OCL
4 {
5 
7  : L(0), m(0)
8  {}
9 
11  : L(L), m(&mutex)
12  {
13  m->lock();
14  }
15 
17  : L(other.L), m(other.m)
18  {
19  // take ownership of the mutex lock
20  other.m = 0;
21  }
22 
24  {
25  if (m) m->unlock();
26  }
27 
29  {
30  if (this == &other) return *this;
31  if (m) m->unlock();
32 
33  this->L = other.L;
34  this->m = other.m;
35 
36  // take ownership of the mutex lock
37  other.m = 0;
38 
39  return *this;
40  }
41 
43  {
44  return L;
45  }
46 
47 } // namespace OCL
lua_State * get() const
virtual void lock()=0
struct lua_State lua_State
Definition: lua-repl.h:54
rt_allocator< U > other
LuaStateHandle & operator=(const LuaStateHandle &)
RTT::os::MutexInterface * m
virtual void unlock()=0


ocl
Author(s): OCL Development Team
autogenerated on Wed Jun 26 2019 19:26:27