Fix: Always check pthread_create for failures
authorEric Wong <normalperson@yhbt.net>
Sun, 2 Oct 2022 16:13:43 +0000 (12:13 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mon, 3 Oct 2022 14:40:10 +0000 (10:40 -0400)
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 <normalperson@yhbt.net>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Change-Id: Ia2695ea6953b589ac8ab8b444fb668daee06a614

src/urcu-defer-impl.h

index 0c8339997d0501d3719344e965bd2d7c74e34ff7..603cc85fc368561efc38eb9cf1ed705fa5c97378 100644 (file)
@@ -411,7 +411,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)
This page took 0.025623 seconds and 4 git commands to generate.