INTRODUCTION Overview Download and Install Documentation Publications REPOSITORY Libraries DEVELOPER Dev Guide Dashboard PEOPLE Contributors Users Project Download Mailing lists
|
gbxsickacfr::gbxiceutilacfr::Thread Class ReferenceA minor extention of the IceUtil::Thread class. More...
Inherited by gbxsickacfr::gbxiceutilacfr::SafeThread, gbxsickacfr::gbxiceutilacfr::SubsystemThread, TestThread, TestThreadWithExit, TestThreadWithNap, TestThreadWithThrow, and TestThreadWithWait. Inheritance diagram for gbxsickacfr::gbxiceutilacfr::Thread: ![]()
Detailed DescriptionA minor extention of the IceUtil::Thread class.Adds an option to stop a thread with stop(). Requires that the thread periodically checks whether it has to stop by calling isStopping(); Since stop() is public, it can be called from inside or outside of the derived class. To use this class, simply overload the virtual IceUtil::Thread::run() function. void MyThread::run() { // initialize // main loop while ( !isStopping() ) { // do something } // clean up } The implicit state machine of this class has 4 states {Starting, Running, Stopping, Stopped}. Events and the corresponding state transitions are listed below. Note that the final state may only be accessed when using smart pointer gbxiceutilacfr::ThreadPtr (otherwise the thread self-destructs).
EVENT : Constructor IceUtil::Thread::Thread() TRANSITION : Starting INTERNAL : isStopping()=false, isAlive()=false, isStarted()=false EVENT : IceUtil::Thread::start() TRANSITION : Starting -> Running INTERNAL : isStopping()=false, isAlive()=true, isStarted()=true EVENT : gbxiceutilacfr::Thread::stop() TRANSITION : Running -> Stopping INTERNAL : isStopping()=true, isAlive()=true, isStarted()=true EVENT : termination of run() function. TRANSITION : Stopping -> Stopped INTERNAL : isStopping()=true, isAlive()=false, isStarted()=true Caveats:
Member Function Documentation
Depricated function! Use isStopping() instead (note that it returns the opposite). Returns FALSE if thread was told to stop, TRUE otherwise.
Lets the thread know that it's time to stop. Thread-safe, so it can be called from inside or outside this thread.
The documentation for this class was generated from the following files:
|