22 #include "timer_thread.h" 24 #include <core/threading/mutex.h> 25 #include <core/threading/mutex_locker.h> 26 #include <core/threading/wait_condition.h> 54 while (!queued_wait_until_.
is_zero()) {
61 woken = waitcond_->
abstimed_wait(wait_until.get_sec(), wait_until.get_nsec());
62 }
while (woken && !aborted_);
82 queued_wait_until_ = wait_until;
87 queued_wait_until_ = wait_until;
Callback listener pure virtual class.
virtual void loop()
Code to execute in the thread.
virtual ~PlexilTimerThread()
Empty destructor.
Wait until a given condition holds.
Fawkes library namespace.
PlexilTimerThread()
Constructor.
void unlock()
Unlock the mutex.
void wake_all()
Wake up all waiting threads.
A class for handling time.
Thread class encapsulation of pthreads.
bool waiting() const
Check if thread is currently waiting for wakeup.
void unlock()
Unlock the mutex.
void wakeup()
Wake up thread.
bool is_zero() const
Check if time is zero.
void set_time(const timeval *tv)
Sets the time.
void lock()
Lock this mutex.
void start_timer(CallbackListener *listener, const fawkes::Time &wait_until)
Start timer non-blocking.
Mutex mutual exclusion lock.
virtual void timer_event()=0
Called for timer events.
bool abstimed_wait(long int sec, long int nanosec)
Wait with absolute timeout.
void abort_timer()
Abort a currently running timer.