From: Samuel Thibault Date: Tue, 7 Jan 2025 00:02:20 +0000 (+0100) Subject: htl: Fix making pthread_join check timeout value X-Git-Tag: glibc-2.41~123 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=7bc54f0965e185e567271c49971bd20c3f2a0663;p=thirdparty%2Fglibc.git htl: Fix making pthread_join check timeout value --- diff --git a/htl/pt-join.c b/htl/pt-join.c index 5ecd0c7eb2..4e4798a476 100644 --- a/htl/pt-join.c +++ b/htl/pt-join.c @@ -49,12 +49,18 @@ __pthread_join_common (pthread_t thread, void **status, int try, /* Rely on pthread_cond_wait being a cancellation point to make pthread_join one too. */ - while (pthread->state == PTHREAD_JOINABLE && err != ETIMEDOUT) + while (pthread->state == PTHREAD_JOINABLE && err != ETIMEDOUT && err != EINVAL) err = __pthread_cond_clockwait (&pthread->state_cond, &pthread->state_lock, clockid, abstime); pthread_cleanup_pop (0); + + if (err == EINVAL) + { + __pthread_mutex_unlock (&pthread->state_lock); + return err; + } } switch (pthread->state)