Commit 864b5df8 authored by Scott Vokes's avatar Scott Vokes
Browse files

Fix result check for pthread_join on shutdown/cleanup.

parent e8736d52
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -235,9 +235,13 @@ static bool notify_shutdown(struct threadpool *t) {
            done++;
        } else if (ti->status == STATUS_SHUTDOWN) {
            void *v = NULL;
            if (pthread_join(ti->t, &v)) {
            int joinres = pthread_join(ti->t, &v);
            if (0 == joinres) {
                ti->status = STATUS_JOINED;
                done++;
            } else {
                fprintf(stderr, "pthread_join: %d\n", joinres);
                assert(joinres == ESRCH);
            }
        } else {
            close(ti->parent_fd);