The nrtThread
class defines a process (method) that be threaded. This
is an abstract class since the threaded method, execute(void *)
, is
purely virtual.
When this class is derived, it is expected that either create(void *)
or createDetached(void *)
is called explicitly (e.g. in the
constructor). create
makes a joinable thread, and
createDetached
a detached one.
In both cases, the th protected variable holds the last created thread identifier.
nrtThread
holds a internal synchronisation variable that can,
directly or not, used through the kill(nrtThread *)
(current thread
activates de conditional variable of the given thread) and
wait(pthread_cond_t *_cond = 0)
(current thread is waiting for the
activation of a synchronisation variable, its own by default) methods.
nrtCyclicThread
(inherited from nrtThread
) has a special
behaviour; it calls the virtual handle(void)
method periodicaly.
Use setSecs(int)
or Secs(void)
to access period.
The internal EOT parameter has to be set to 1 whenever the thread has to be killed.