Skip to content

Commit

Permalink
Revert change to report interval logic
Browse files Browse the repository at this point in the history
In 75acb36 the `else` block was changed to an `else if` at line 418.  This caused the pthread_cond_wait to fall outside of the else condition, which let the decision thread block indefinitely when a report interval was enabled.

The fix is to restore the else so that the untimed blocking pthread call is only made when reporting is not enabled.
  • Loading branch information
jw3 committed Nov 26, 2024
1 parent f76484b commit 409ca5b
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions src/daemon/notify.c
Original file line number Diff line number Diff line change
Expand Up @@ -414,14 +414,17 @@ static void *decision_thread_main(void *arg)
pthread_cond_timedwait(&do_decision,
&decision_lock,
&rpt_timeout);
} else if (run_stats) {
rpt_write();
run_stats = 0;
} else {
if (run_stats) {
rpt_write();
run_stats = 0;
}
if (stop)
break;

// no interval reports, await a fan event indefinitely
pthread_cond_wait(&do_decision, &decision_lock);
}
// no interval reports, await a fan event indefinitely
if (stop)
break;
pthread_cond_wait(&do_decision, &decision_lock);
}

if (stop) {
Expand Down

0 comments on commit 409ca5b

Please sign in to comment.