Commit 20c6d705 authored by Philippe Gorley's avatar Philippe Gorley

thread: add way to notify waiting thread of changes

Don't notify on stop.

Change-Id: Ic3eead63c4756d1790da1ba7223a431cbc238232
parent daa247f6
......@@ -142,7 +142,6 @@ void
InterruptedThreadLoop::stop()
{
ThreadLoop::stop();
std::lock_guard<std::mutex> lk(mutex_);
cv_.notify_one();
}
} // namespace ring
......@@ -86,6 +86,11 @@ public:
void stop() override;
void interrupt() noexcept
{
cv_.notify_one();
}
template <typename Rep, typename Period>
void
wait_for(const std::chrono::duration<Rep, Period>& rel_time)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment