From: Eric Wong Date: Sun, 2 Oct 2022 16:13:43 +0000 (-0400) Subject: Fix: Always check pthread_create for failures X-Git-Tag: v0.14.0~14 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=8c677380d0f9241b9cd548082cf843c5111736d8;p=userspace-rcu.git Fix: Always check pthread_create for failures pthread_create may fail with EAGAIN (which is no fault of the programmer), so don't allow the check to be compiled out. Signed-off-by: Eric Wong Signed-off-by: Mathieu Desnoyers Change-Id: Ia2695ea6953b589ac8ab8b444fb668daee06a614 --- diff --git a/src/urcu-defer-impl.h b/src/urcu-defer-impl.h index 1c96287..cbb0ca8 100644 --- a/src/urcu-defer-impl.h +++ b/src/urcu-defer-impl.h @@ -417,7 +417,8 @@ static void start_defer_thread(void) urcu_posix_assert(!ret); ret = pthread_create(&tid_defer, NULL, thr_defer, NULL); - urcu_posix_assert(!ret); + if (ret) + urcu_die(ret); ret = pthread_sigmask(SIG_SETMASK, &oldmask, NULL); urcu_posix_assert(!ret);