Merge branch 'master' into custom_alt
This commit is contained in:
commit
6633e34bbd
|
@ -56,11 +56,12 @@ private:
|
||||||
const std::string preferred_device_;
|
const std::string preferred_device_;
|
||||||
static constexpr int EPOLL_MAX_EVENTS = 16;
|
static constexpr int EPOLL_MAX_EVENTS = 16;
|
||||||
|
|
||||||
waybar::util::SleeperThread udev_thread_;
|
|
||||||
std::mutex udev_thread_mutex_;
|
|
||||||
std::vector<BacklightDev> devices_;
|
|
||||||
|
|
||||||
std::optional<BacklightDev> previous_best_;
|
std::optional<BacklightDev> previous_best_;
|
||||||
std::string previous_format_;
|
std::string previous_format_;
|
||||||
|
|
||||||
|
std::mutex udev_thread_mutex_;
|
||||||
|
std::vector<BacklightDev> devices_;
|
||||||
|
// thread must destruct before shared data
|
||||||
|
waybar::util::SleeperThread udev_thread_;
|
||||||
};
|
};
|
||||||
} // namespace waybar::modules
|
} // namespace waybar::modules
|
||||||
|
|
|
@ -149,6 +149,9 @@ waybar::modules::Backlight::Backlight(const std::string &name,
|
||||||
const int event_count =
|
const int event_count =
|
||||||
epoll_wait(epoll_fd.get(), events, EPOLL_MAX_EVENTS,
|
epoll_wait(epoll_fd.get(), events, EPOLL_MAX_EVENTS,
|
||||||
std::chrono::milliseconds{interval_}.count());
|
std::chrono::milliseconds{interval_}.count());
|
||||||
|
if (!udev_thread_.isRunning()) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
decltype(devices_) devices;
|
decltype(devices_) devices;
|
||||||
{
|
{
|
||||||
std::scoped_lock<std::mutex> lock(udev_thread_mutex_);
|
std::scoped_lock<std::mutex> lock(udev_thread_mutex_);
|
||||||
|
|
Loading…
Reference in New Issue