---
 htl/pt-join.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

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)
-- 
2.45.2


Reply via email to