diff --git a/src/unix/threadpool.c b/src/unix/threadpool.c index 1036e68cf..0a02766e6 100644 --- a/src/unix/threadpool.c +++ b/src/unix/threadpool.c @@ -101,11 +101,8 @@ static void cleanup(void) { for (i = 0; i < ARRAY_SIZE(threads); i++) { err = pthread_join(threads[i], NULL); - - if (err == 0 || err == ESRCH) - continue; - - abort(); + assert(err == 0 || err == EINVAL || err == ESRCH); + (void) err; /* Silence compiler warning in release builds. */ } }