Fawkes API
Fawkes Development Version
|
Blocked timing executor. More...
#include <>>
Public Member Functions | |
virtual | ~BlockedTimingExecutor () |
Virtual empty destructor. More... | |
virtual void | wakeup_and_wait (BlockedTimingAspect::WakeupHook hook, unsigned int timeout_usec=0)=0 |
Wakeup thread for given hook and wait for completion. More... | |
virtual void | wakeup (BlockedTimingAspect::WakeupHook hook, Barrier *barrier=0)=0 |
Wakeup thread for given hook. More... | |
virtual void | try_recover (std::list< std::string > &recovered_threads)=0 |
Try to recover threads. More... | |
virtual bool | timed_threads_exist ()=0 |
Check if any timed threads exist. More... | |
virtual void | wait_for_timed_threads ()=0 |
Wait for timed threads. More... | |
virtual void | interrupt_timed_thread_wait ()=0 |
Interrupt any currently running wait_for_timed_threads() and cause it to throw an InterruptedException. More... | |
Blocked timing executor.
This interface defines access to threads with the blocked timing aspect.
Definition at line 35 of file executor.h.
|
virtual |
Virtual empty destructor.
Definition at line 81 of file executor.cpp.
|
pure virtual |
Interrupt any currently running wait_for_timed_threads() and cause it to throw an InterruptedException.
Implemented in fawkes::ThreadManager.
|
pure virtual |
Check if any timed threads exist.
Implemented in fawkes::ThreadManager.
|
pure virtual |
Try to recover threads.
An advanced BlockedTimingExecutor might be able to detect deadlocked threads. In this case this function should be called regularly to allow for recovering threads that are back to normal operation.
recovered_threads | upon return the names of any threads that could be recovered from a bad state have been added to the list. |
Implemented in fawkes::ThreadManager.
|
pure virtual |
Wait for timed threads.
Use this method to wait until a timed that is added to the thread manager. Note that an InterruptedException is thrown if interrup_timed_thread_wait() is called from another thread. You should catch this exception and stop the loop execution.
InterruptedException | thrown if another thread calls interrupt_timed_thread_wait() |
Implemented in fawkes::ThreadManager.
|
pure virtual |
Wakeup thread for given hook.
This will wakeup all threads registered for the given hook. With the optional barrier you can synchronize to the end of the loop execution of the threads of the given hook.
hook | hook for which to wait for |
barrier | optional barrier that can be used to synchronize to the end of the loop execution of the threads. |
Implemented in fawkes::ThreadManager.
|
pure virtual |
Wakeup thread for given hook and wait for completion.
This will wakeup all threads registered for the given hook. Afterwards this method will block until all threads finished their loop.
hook | hook for which to wait for |
timeout_usec | timeout for thread execution in usec. 0 disables the timeout and makes this function to wait forever. |
Exception | thrown if the timeout was exceeded (at least one of the threads for the given hook took longer than the desired time. |
Implemented in fawkes::ThreadManager.
Referenced by TimeTrackerMainLoopThread::loop().