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