Skip to content

Commit 4685d05

Browse files
authored
Merge pull request #148 from mkhon/fix-wait_thread_loop
Don't call sigwaitinfo(2) with disabled pthread cancellation state
2 parents 009c100 + 2cc0092 commit 4685d05

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

src/posix/proc.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -288,16 +288,17 @@ wait_thread_loop(UNUSED void *arg)
288288
pthread_cond_signal(&proc_wait_thread_cond);
289289
pthread_mutex_unlock(&proc_wait_thread_mtx);
290290
do {
291+
if (ret < 0) {
292+
dbg_printf("sigwaitinfo(2): %s", strerror(errno));
293+
continue;
294+
}
295+
291296
/*
292297
* Don't allow the thread to be cancelled until we've
293298
* finished one loop in the monitoring thread. This
294299
* ensures there are no nasty issue on exit.
295300
*/
296301
pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, NULL);
297-
if (ret < 0) {
298-
dbg_printf("sigwaitinfo(2): %s", strerror(errno));
299-
continue;
300-
}
301302

302303
/*
303304
* The knote_* functions (i.e. those that could free a

0 commit comments

Comments
 (0)