TermOx
|
Thread that waits to be notified, then performs some action. More...
#include <listener_thread.hpp>
Public Member Functions | |
Listener_thread (Function_t &&action) | |
Launch the listener thread. More... | |
~Listener_thread () | |
Shutdown the listener thread. | |
void | launch () |
Start the thread that will wait for notification. | |
void | notify () |
Wakes up the thread and has it run the action once. | |
void | exit () |
Notify the thread to exit. | |
void | wait () |
Blocks until the thread is dead. | |
Thread that waits to be notified, then performs some action.
Parameterized on the action that will be taken, with Function_t. This is basically a wrapped condition variable that helps you launch and exit a new thread.
|
inline |
Launch the listener thread.
Function_t can be any (zero argument)invokable with a move or copy constructor.