mirror of
https://github.com/rad4day/Waybar.git
synced 2023-12-21 10:22:59 +01:00
fix(custom): exit status
This commit is contained in:
parent
3c9b533997
commit
564fdcb369
@ -33,7 +33,7 @@ inline int close(FILE* fp, pid_t pid) {
|
||||
fclose(fp);
|
||||
while (waitpid(pid, &stat, 0) == -1) {
|
||||
if (errno != EINTR) {
|
||||
stat = -1;
|
||||
stat = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -14,7 +14,10 @@ class SleeperThread {
|
||||
|
||||
SleeperThread(std::function<void()> func)
|
||||
: thread_{[this, func] {
|
||||
while (do_run_) func();
|
||||
while (do_run_) {
|
||||
signal_ = false;
|
||||
func();
|
||||
}
|
||||
}} {}
|
||||
|
||||
SleeperThread& operator=(std::function<void()> func) {
|
||||
@ -42,7 +45,10 @@ class SleeperThread {
|
||||
}
|
||||
|
||||
auto wake_up() {
|
||||
signal_ = true;
|
||||
{
|
||||
std::lock_guard<std::mutex> lck(mutex_);
|
||||
signal_ = true;
|
||||
}
|
||||
condvar_.notify_all();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user