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:30 +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 f1fae9c0d15ce4364a44d511f2a4701febe0c4b5..36b7659461bbb55d0da9e5c2e4269c0a362b09a8 100644 (file)
@@ -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)
This page took 0.024966 seconds and 4 git commands to generate.