]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
htl: Fix making pthread_join check timeout value
authorSamuel Thibault <samuel.thibault@ens-lyon.org>
Tue, 7 Jan 2025 00:02:20 +0000 (01:02 +0100)
committerSamuel Thibault <samuel.thibault@ens-lyon.org>
Tue, 7 Jan 2025 00:02:20 +0000 (01:02 +0100)
htl/pt-join.c

index 5ecd0c7eb2e3ad147132db262a25c4f4b615c692..4e4798a476cd379769f9f5490ed9e60822cbf207 100644 (file)
@@ -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)