repo.or.cz
/
tomato.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
UPS: apcupsd clean sources
[tomato.git]
/
release
/
src
/
router
/
apcupsd
/
include
/
athread.h
blob
cf88a25bc7ee3f20db57aa82ededbf590afd38eb
1
#ifndef __ATHREAD_H
2
#define __ATHREAD_H
3
4
#include <pthread.h>
5
6
class
athread
7
{
8
public
:
9
10
athread
(
int
prio
=
PRIORITY_INHERIT
)
11
:
_prio
(
prio
),
12
_running
(
false
) {}
13
14
virtual
~
athread
() {}
15
16
virtual
bool
run
();
17
virtual
bool
join
();
18
19
protected
:
20
21
virtual
void
body
() =
0
;
22
23
static void
*
springboard
(
void
*
arg
);
24
25
static const int
PRIORITY_INHERIT
;
26
27
pthread_t _tid
;
28
int
_prio
;
29
bool
_running
;
30
};
31
32
#endif