OpenCPN Partial API docs
|
Thread mixin providing a "stop thread"/"wait until stopped" interface. More...
#include <thread_ctrl.h>
Public Member Functions | |
bool | IsRunning () const |
Return true if thread is running. | |
virtual void | RequestStop () |
Request that thread stops operation. | |
void | WaitUntilStopped () |
Block until thread invokes SignalExit(). | |
bool | WaitUntilStopped (std::chrono::duration< int > timeout) |
Block until thread invokes SignalExit() or timeout. | |
bool | WaitUntilStopped (std::chrono::duration< int > timeout, std::chrono::milliseconds &elapsed) |
Block until thread invokes SignalExit() or timeout. | |
Protected Member Functions | |
bool | KeepGoing () const |
If true continue thread operation, else exit and invoke SignalExit() | |
void | SignalExit () |
Signal that thread has exited. | |
Thread mixin providing a "stop thread"/"wait until stopped" interface.
Definition at line 32 of file thread_ctrl.h.
|
inline |
Definition at line 34 of file thread_ctrl.h.
|
inline |
Return true if thread is running.
Definition at line 37 of file thread_ctrl.h.
|
protected |
If true continue thread operation, else exit and invoke SignalExit()
Definition at line 55 of file thread_ctrl.cpp.
|
virtual |
Request that thread stops operation.
Reimplemented in AndroidSerialIo, and SerialIo.
Definition at line 27 of file thread_ctrl.cpp.
|
protected |
Signal that thread has exited.
Definition at line 60 of file thread_ctrl.cpp.
void ThreadCtrl::WaitUntilStopped | ( | ) |
Block until thread invokes SignalExit().
Definition at line 32 of file thread_ctrl.cpp.
bool ThreadCtrl::WaitUntilStopped | ( | std::chrono::duration< int > | timeout | ) |
Block until thread invokes SignalExit() or timeout.
Definition at line 37 of file thread_ctrl.cpp.
bool ThreadCtrl::WaitUntilStopped | ( | std::chrono::duration< int > | timeout, |
std::chrono::milliseconds & | elapsed | ||
) |
Block until thread invokes SignalExit() or timeout.
timeout | Maximum time to wait for thread to exit. |
elapsed | On exit, the time spent in method. |
Definition at line 43 of file thread_ctrl.cpp.