Permalink
Browse files

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.
  • Loading branch information...
bnoordhuis committed Oct 6, 2012
1 parent b152b12 commit b9ed1a6dbf0ea5f58ce6c93ac99e738579b84b5a
Showing with 2 additions and 5 deletions.
  1. +2 −5 src/unix/threadpool.c
View
@@ -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. */
}
}

0 comments on commit b9ed1a6

Please sign in to comment.