Now you can download a copy of these docs so you can use them offline! Download now
DefaultThreadManager.h
1 /*
2  * DefaultThreadManager.h
3  * Desktop
4  *
5  * Created on: Sep 21, 2012
6  * Author: Mitchell Wills
7  */
8 
9 #ifndef DEFAULTTHREADMANAGER_H_
10 #define DEFAULTTHREADMANAGER_H_
11 
12 
14 class PeriodicNTThread;
15 
16 #include "networktables2/thread/PeriodicRunnable.h"
17 #include "networktables2/thread/NTThreadManager.h"
18 #include "networktables2/thread/NTThread.h"
19 
20 #if (defined __vxworks || defined WIN32)
21 #include "OSAL/Task.h"
22 #else
23 #include <pthread.h>
24 #endif
25 
27 public:
28  virtual NTThread* newBlockingPeriodicThread(PeriodicRunnable* r, const char* name);
29 };
30 
31 class PeriodicNTThread : public NTThread {
32 private:
33 #if (defined __vxworks || defined WIN32)
34  const char* name;
35  NTTask* thread;
36 #else
37  pthread_t thread;
38 #endif
40  bool run;
41 #if (defined __vxworks || defined WIN32)
42  int _taskMain();
43  static int taskMain(PeriodicNTThread* o);
44 #else//TODO make return int for pthread as well
45  void _taskMain();
46  static void* taskMain(PeriodicNTThread* o);
47 #endif
48 public:
49  PeriodicNTThread(PeriodicRunnable* r, const char* name);
50  virtual ~PeriodicNTThread();
51  virtual void stop();
52  virtual bool isRunning();
53 };
54 
55 #endif /* DEFAULTTHREADMANAGER_H_ */
virtual NTThread * newBlockingPeriodicThread(PeriodicRunnable *r, const char *name)
virtual bool isRunning()

Generated on Sat Apr 26 2014 12:26:45 for WPILibC++ by doxygen 1.8.6