|
OpenCPN Partial API docs
|
Thread mixin providing a "stop thread"/"wait until stopped" interface. More...
#include <thread_ctrl.h>
Public Member Functions | |
| virtual | ~ThreadCtrl ()=default |
| Destroy the Thread Ctrl object. | |
| 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 31 of file thread_ctrl.h.
|
inline |
Definition at line 33 of file thread_ctrl.h.
|
inline |
Return true if thread is running.
Definition at line 41 of file thread_ctrl.h.
|
protected |
If true continue thread operation, else exit and invoke SignalExit()
Definition at line 54 of file thread_ctrl.cpp.
|
virtual |
Request that thread stops operation.
Reimplemented in AndroidSerialIo, and SerialIo.
Definition at line 26 of file thread_ctrl.cpp.
|
protected |
Signal that thread has exited.
Definition at line 59 of file thread_ctrl.cpp.
| void ThreadCtrl::WaitUntilStopped | ( | ) |
Block until thread invokes SignalExit().
Definition at line 31 of file thread_ctrl.cpp.
| bool ThreadCtrl::WaitUntilStopped | ( | std::chrono::duration< int > | timeout | ) |
Block until thread invokes SignalExit() or timeout.
Definition at line 36 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 42 of file thread_ctrl.cpp.