From 225ad775ba2841f484f66297d5aff4e3de70f249 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sun, 2 Oct 2022 12:13:43 -0400 Subject: [PATCH] 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 --- src/urcu-defer-impl.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/urcu-defer-impl.h b/src/urcu-defer-impl.h index f1fae9c..36b7659 100644 --- a/src/urcu-defer-impl.h +++ b/src/urcu-defer-impl.h @@ -416,7 +416,8 @@ static void start_defer_thread(void) int ret; ret = pthread_create(&tid_defer, NULL, thr_defer, NULL); - assert(!ret); + if (ret) + urcu_die(ret); } static void stop_defer_thread(void) -- 2.34.1