From b9ed1a6dbf0ea5f58ce6c93ac99e738579b84b5a Mon Sep 17 00:00:00 2001 From: Ben Noordhuis Date: Sat, 6 Oct 2012 22:45:26 +0200 Subject: [PATCH] unix: don't abort() on EINVAL in threadpool.c The FreeBSD implementation of pthread_join() returns EINVAL when a thread has already quit, not ESRCH. --- src/unix/threadpool.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/unix/threadpool.c b/src/unix/threadpool.c index 1036e68c..0a02766e 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. */ } }