Wake all sleeping threads when leaving suspend

std::condition_variable::wait_for does not count time spent in sleep
mode, resulting in longer than expected waits.
This commit is contained in:
Patrick Nicolas
2023-06-07 10:17:42 +02:00
parent c5379fa52d
commit 3c9cbc99d7
4 changed files with 73 additions and 2 deletions

View File

@ -0,0 +1,9 @@
#pragma once
#include "SafeSignal.hpp"
namespace waybar::util {
// Get a signal emited with value true when entering sleep, and false when exiting
SafeSignal<bool>& prepare_for_sleep();
} // namespace waybar::util