Merge pull request #2588 from taminob/bugfix/fix-custom-module-signal-without-interval

Custom module: Allow signal without interrupt
This commit is contained in:
Alexis Rouillard 2023-10-21 14:09:12 +02:00 committed by GitHub
commit 06f4028697
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -61,7 +61,7 @@ class SleeperThread {
auto sleep() { auto sleep() {
std::unique_lock lk(mutex_); std::unique_lock lk(mutex_);
CancellationGuard cancel_lock; CancellationGuard cancel_lock;
return condvar_.wait(lk); return condvar_.wait(lk, [this] { return signal_ || !do_run_; });
} }
auto sleep_for(std::chrono::system_clock::duration dur) { auto sleep_for(std::chrono::system_clock::duration dur) {