Tekkotsu Homepage | Demos | Overview | Downloads | Dev. Resources | Reference | Credits |
FailsafeThread Class ReferenceEnforces a timeout on another thread. More...
Inheritance diagram for FailsafeThread:
Detailed DescriptionEnforces a timeout on another thread. The target thread needs to either complete execution or set the progressFlag to 'true' within the specified timeout period. If the progressFlag is set, it will be cleared at the end of the timeout, thus requiring the target to re-set within the next timeout period. Definition at line 13 of file FailsafeThread.h.
Constructor & Destructor Documentation
constructor, specify target thread, timeout period, and optionally whether to start now Definition at line 16 of file FailsafeThread.h. Member Function Documentation
returns true if the FailsafeThread is waiting for the target to stop running This is useful for the target thread to check whether it is being stopped from a timeout (in which case isEngaged() will return true), or if it has been stopped for some other reason. Definition at line 36 of file FailsafeThread.h.
override this as a convenient way to define your thread -- return the number of *micro*seconds to sleep before the next call; return -1U to indicate end of processing Reimplemented from Thread. Definition at line 39 of file FailsafeThread.h. Member Data Documentation
microseconds to wait between checks on progressFlag Changing this value won't change the current timeout period. You would need to stop and restart the thread for a change to immediately take effect. Definition at line 28 of file FailsafeThread.h. Referenced by runloop().
set to true when FailsafeThread is in the process of stopping (and possibly restarting) the target thread Definition at line 75 of file FailsafeThread.h. Referenced by isEngaged(), and runloop().
the function to call on the target thread, defaults to Thread::stop, but Thread::interrupt may be useful Definition at line 31 of file FailsafeThread.h. Referenced by runloop().
should be set by target thread if it's still making progress and wants another delay Definition at line 23 of file FailsafeThread.h. Referenced by runloop().
if set to true, the failsafe thread will restart the target if it times out instead of just stopping it Definition at line 20 of file FailsafeThread.h. Referenced by runloop().
the thread being monitored (or at least the one that will be stopped if progressFlag isn't set) Definition at line 72 of file FailsafeThread.h. Referenced by runloop(). The documentation for this class was generated from the following file: |
Tekkotsu v5.1CVS |
Generated Mon May 9 04:59:07 2016 by Doxygen 1.6.3 |