26 #ifndef INCLUDED_RunLoopManagerStd_h_GUID_34945132_5355_45A8_A7D6_073C7C8C235A 27 #define INCLUDED_RunLoopManagerStd_h_GUID_34945132_5355_45A8_A7D6_073C7C8C235A 39 #include <condition_variable> 55 void signalShutdown();
60 void reportStateChange_(RunningState s);
62 std::condition_variable stateCond_;
64 typedef std::unique_lock<std::mutex> Lock;
67 volatile RunningState currentState_;
70 inline void RunLoopManagerStd::signalStart() {
79 while (currentState_ != STATE_RUNNING) {
80 stateCond_.wait(condGuard);
85 inline void RunLoopManagerStd::signalShutdown() {
94 while (currentState_ != STATE_STOPPED) {
95 stateCond_.wait(condGuard);
100 RunLoopManagerStd::reportStateChange_(RunLoopManagerBase::RunningState s) {
102 Lock condGuard(mut_);
105 stateCond_.notify_all();
110 #endif // INCLUDED_RunLoopManagerStd_h_GUID_34945132_5355_45A8_A7D6_073C7C8C235A void signalAndWaitForStart()
Set up for run loop to start, then block until we have confirmation that the run loop is running...
Definition: RunLoopManagerStd.h:75
Definition: RunLoopManagerStd.h:43
Definition: RunLoopManager.h:42
Base class for implementations of a RunLoopManager that use various synchronization libraries...
Definition: RunLoopManager.h:65
void signalAndWaitForShutdown()
Send a message to the run loop that it should stop, and wait until it does.
Definition: RunLoopManagerStd.h:90
void setShouldStop_(bool value)
internal utility function.
Definition: RunLoopManager.h:143