sttcl  v0.9c
STTCL C++ template state machine framework
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
SttclCx11Thread.h
Go to the documentation of this file.
1 
25 #ifndef STTCLCX11THREAD_H_
26 #define STTCLCX11THREAD_H_
27 
28 #if defined(STTCL_CX11_THREADS) or defined(STTCL_CX11_IMPL)
29 #include <thread>
30 
31 namespace sttcl
32 {
33 namespace internal
34 {
35 namespace cx11_impl
36 {
40 class SttclCx11Thread
41 {
42 public:
43  typedef std::thread ThreadNativeType;
44 
45  typedef void* (*ThreadMethodPtr)(void*);
46 
47  SttclCx11Thread(ThreadMethodPtr argThreadMethod);
48  virtual ~SttclCx11Thread();
49 
50  bool run(void* args);
51  void join();
52  void detach();
53  static bool isSelf(const SttclCx11Thread& otherThread);
54 
55 private:
56  ThreadMethodPtr threadMethod;
57  ThreadNativeType thread;
58 
59 };
60 }
61 }
62 }
63 #endif
64 #endif /* STTCLCX11THREAD_H_ */