sttcl  v0.9c
STTCL C++ template state machine framework
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
SttclCx11Mutex.h
Go to the documentation of this file.
1 
25 #ifndef STTCLCX11MUTEX_H_
26 #define STTCLCX11MUTEX_H_
27 #if defined(STTCL_CX11_THREADS) or defined(STTCL_CX11_IMPL)
28 
29 #include "../include/SttclTime.h"
30 #include <mutex>
31 
32 namespace sttcl
33 {
34 
35 namespace internal
36 {
37 namespace cx11_impl
38 {
42 class SttclCx11Mutex
43 {
44 public:
45  typedef std::timed_mutex NativeMutexType;
46  SttclCx11Mutex();
47  virtual ~SttclCx11Mutex();
48 
49  void lock();
50  bool try_lock(const TimeDuration<>& timeout);
51  void unlock();
52 
53 private:
54  NativeMutexType mutex;
55 };
56 
57 }
58 }
59 }
60 #endif
61 #endif /* STTCLCX11MUTEX_H_ */