Public Member Functions

fawkes::BlockedTimingExecutor Class Reference

Blocked timing executor. More...

#include <>>

Inheritance diagram for fawkes::BlockedTimingExecutor:
Inheritance graph
[legend]

List of all members.

Public Member Functions

virtual ~BlockedTimingExecutor ()
 Virtual empty destructor.
virtual void wakeup_and_wait (BlockedTimingAspect::WakeupHook hook, unsigned int timeout_usec=0)=0
 Wakeup thread for given hook and wait for completion.
virtual void wakeup (BlockedTimingAspect::WakeupHook hook, Barrier *barrier=0)=0
 Wakeup thread for given hook.
virtual void try_recover (std::list< std::string > &recovered_threads)=0
 Try to recover threads.
virtual bool timed_threads_exist ()=0
 Check if any timed threads exist.
virtual void wait_for_timed_threads ()=0
 Wait for timed threads.
virtual void interrupt_timed_thread_wait ()=0
 Interrupt any currently running wait_for_timed_threads() and cause it to throw an InterruptedException.

Detailed Description

Blocked timing executor.

This interface defines access to threads with the blocked timing aspect.

Author:
Tim Niemueller

Definition at line 35 of file executor.h.


Constructor & Destructor Documentation

fawkes::BlockedTimingExecutor::~BlockedTimingExecutor (  )  [virtual]

Virtual empty destructor.

Definition at line 81 of file executor.cpp.


Member Function Documentation

void fawkes::BlockedTimingExecutor::interrupt_timed_thread_wait (  )  [pure virtual]

Interrupt any currently running wait_for_timed_threads() and cause it to throw an InterruptedException.

Implemented in FawkesThreadManager.

bool fawkes::BlockedTimingExecutor::timed_threads_exist (  )  [pure virtual]

Check if any timed threads exist.

Returns:
true if threads exist that need to be woken up for execution, false otherwise

Implemented in FawkesThreadManager.

void fawkes::BlockedTimingExecutor::try_recover ( std::list< std::string > &  recovered_threads  )  [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.

Parameters:
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 FawkesThreadManager.

void fawkes::BlockedTimingExecutor::wait_for_timed_threads (  )  [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.

Exceptions:
InterruptedException thrown if another thread calls interrupt_timed_thread_wait()

Implemented in FawkesThreadManager.

void fawkes::BlockedTimingExecutor::wakeup ( BlockedTimingAspect::WakeupHook  hook,
Barrier barrier = 0 
) [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.

Parameters:
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 FawkesThreadManager.

void fawkes::BlockedTimingExecutor::wakeup_and_wait ( BlockedTimingAspect::WakeupHook  hook,
unsigned int  timeout_usec = 0 
) [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.

Parameters:
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.
Exceptions:
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 FawkesThreadManager.


The documentation for this class was generated from the following files: