MADARA
3.1.8
|
Thread executing timed events. More...
#include <TimedEventThread.h>
Public Member Functions | |
TimedEventThread (TimedEventThreadInfo &info) | |
Constructor. More... | |
~TimedEventThread () | |
Destructor. More... | |
int | svc (void) |
Service loop for the thread. More... | |
Private Attributes | |
TimedEventThreadInfo | info_ |
info for service loop More... | |
CompiledExpression | queued_or_terminated_ |
expression for checking if events are queued or terminated More... | |
CompiledExpression | thread_closed_ |
expression for letting control plane know the thread is closed More... | |
Thread executing timed events.
Definition at line 34 of file TimedEventThread.h.
madara::knowledge::TimedEventThread::TimedEventThread | ( | TimedEventThreadInfo & | info | ) |
Constructor.
Definition at line 31 of file TimedEventThread.cpp.
madara::knowledge::TimedEventThread::~TimedEventThread | ( | ) |
Destructor.
Definition at line 73 of file TimedEventThread.cpp.
int madara::knowledge::TimedEventThread::svc | ( | void | ) |
Service loop for the thread.
remove returns in one of three conditions 1) an event has a timeout, so cur_event.second is valid 2) an event is in the queue but not timed out, so sleep_time is a valid sleep time (>0.0) 3) there were no events in queue, so we slept on a condition, and we've now been signaled. It is possible that someone else has serviced the event since we were signaled. The result will be 0.0 in sleep_time and a need to try to remove again.
Definition at line 79 of file TimedEventThread.cpp.
|
private |
info for service loop
Definition at line 56 of file TimedEventThread.h.
|
private |
expression for checking if events are queued or terminated
Definition at line 62 of file TimedEventThread.h.
|
private |
expression for letting control plane know the thread is closed
Definition at line 67 of file TimedEventThread.h.