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);
|
fclose(fp);
|
||||||
while (waitpid(pid, &stat, 0) == -1) {
|
while (waitpid(pid, &stat, 0) == -1) {
|
||||||
if (errno != EINTR) {
|
if (errno != EINTR) {
|
||||||
stat = -1;
|
stat = 0;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -14,7 +14,10 @@ class SleeperThread {
|
|||||||
|
|
||||||
SleeperThread(std::function<void()> func)
|
SleeperThread(std::function<void()> func)
|
||||||
: thread_{[this, func] {
|
: thread_{[this, func] {
|
||||||
while (do_run_) func();
|
while (do_run_) {
|
||||||
|
signal_ = false;
|
||||||
|
func();
|
||||||
|
}
|
||||||
}} {}
|
}} {}
|
||||||
|
|
||||||
SleeperThread& operator=(std::function<void()> func) {
|
SleeperThread& operator=(std::function<void()> func) {
|
||||||
@ -42,7 +45,10 @@ class SleeperThread {
|
|||||||
}
|
}
|
||||||
|
|
||||||
auto wake_up() {
|
auto wake_up() {
|
||||||
|
{
|
||||||
|
std::lock_guard<std::mutex> lck(mutex_);
|
||||||
signal_ = true;
|
signal_ = true;
|
||||||
|
}
|
||||||
condvar_.notify_all();
|
condvar_.notify_all();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user