Main Page
Namespaces
Classes
Files
File List
OpenRTM_aist
Task.py
Go to the documentation of this file.
1
#!/usr/bin/env python
2
# -*- coding: euc-jp -*-
3
4
17
18
import
threading
19
20
class
Task
:
21
def
__init__
(self):
22
self.
_count
= 0
23
self.
_thread
=
None
24
return
25
26
27
def
__del__
(self):
28
self.
_count
= 0
29
#if self._thread:
30
# if self._thread.isAlive():
31
# self._thread.join()
32
self.
_thread
=
None
33
return
34
35
36
def
open
(self, args = None):
37
return
0
38
39
40
def
close
(self, flags = 0):
41
return
0
42
43
44
def
svc
(self):
45
return
0
46
47
48
def
activate
(self):
49
if
self.
_count
== 0:
50
self.
_thread
= threading.Thread(target=self.
svc_run
)
51
self.
_count
+= 1
52
self._thread.start()
53
return
54
55
56
def
wait
(self):
57
if
self.
_count
> 0:
58
self._thread.join()
59
return
60
61
62
def
suspend
(self):
63
return
0
64
65
66
def
resume
(self):
67
return
0
68
69
70
def
reset
(self):
71
self.
_count
= 0
72
return
73
74
75
def
finalize
(self):
76
self.
reset
()
77
return
78
79
def
svc_run
(self):
80
self.
svc
()
81
self.
finalize
()
82
return
OpenRTM_aist.Task.Task._thread
_thread
Definition:
Task.py:23
OpenRTM_aist.Task.Task.finalize
def finalize(self)
Definition:
Task.py:75
OpenRTM_aist.Task.Task.svc
def svc(self)
Definition:
Task.py:44
OpenRTM_aist.Task.Task.wait
def wait(self)
Definition:
Task.py:56
OpenRTM_aist.Task.Task.svc_run
def svc_run(self)
Definition:
Task.py:79
OpenRTM_aist.Task.Task.close
def close(self, flags=0)
Definition:
Task.py:40
OpenRTM_aist.Task.Task.open
def open(self, args=None)
Definition:
Task.py:36
OpenRTM_aist.Task.Task.activate
def activate(self)
Definition:
Task.py:48
OpenRTM_aist.Task.Task.suspend
def suspend(self)
Definition:
Task.py:62
OpenRTM_aist.Task.Task.reset
def reset(self)
Definition:
Task.py:70
OpenRTM_aist.Task.Task._count
_count
Definition:
Task.py:22
OpenRTM_aist.Task.Task.__del__
def __del__(self)
Definition:
Task.py:27
OpenRTM_aist.Task.Task.__init__
def __init__(self)
Definition:
Task.py:21
OpenRTM_aist.Task.Task.resume
def resume(self)
Definition:
Task.py:66
OpenRTM_aist.Task.Task
Definition:
Task.py:20
openrtm_aist_python
Author(s): Shinji Kurihara
autogenerated on Thu Jun 6 2019 19:11:34