Home
Roadside
Carputer
geoHist
software
FRC
Blog
Now you can download a copy of these docs so you can use them offline!
Download now
Main Page
Related Pages
Classes
Files
File List
networktables2
thread
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
13
class
DefaultThreadManager
;
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
26
class
DefaultThreadManager
:
public
NTThreadManager
{
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
39
PeriodicRunnable
* r;
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_ */
DefaultThreadManager::newBlockingPeriodicThread
virtual NTThread * newBlockingPeriodicThread(PeriodicRunnable *r, const char *name)
Definition:
DefaultThreadManger.cpp:47
NTThreadManager
Definition:
NTThreadManager.h:22
DefaultThreadManager
Definition:
DefaultThreadManager.h:26
PeriodicNTThread::isRunning
virtual bool isRunning()
Definition:
DefaultThreadManger.cpp:43
PeriodicNTThread::stop
virtual void stop()
Definition:
DefaultThreadManger.cpp:40
PeriodicRunnable
Definition:
PeriodicRunnable.h:17
NTThread
Definition:
NTThread.h:16
PeriodicNTThread
Definition:
DefaultThreadManager.h:31
Generated on Sat Apr 26 2014 12:26:45 for WPILibC++ by
1.8.6
© 2006-2009 Dustin Spicuzza. All rights reserved.
Powered by Onnac
I do not condone or encourage graffiti. Please paint responsibly.