]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
htl: Fix barrier_wait with one thread
authorSamuel Thibault <samuel.thibault@ens-lyon.org>
Sun, 9 Feb 2020 23:02:13 +0000 (23:02 +0000)
committerSamuel Thibault <samuel.thibault@ens-lyon.org>
Mon, 10 Feb 2020 01:03:54 +0000 (01:03 +0000)
sysdeps/htl/pt-barrier-wait.c

index 47ec440b26fd8f6b53203ff6ce0cd020ce4d6e44..146605abd8757d2006a0ecebd0ba2ede9e3d4773 100644 (file)
@@ -29,7 +29,9 @@ pthread_barrier_wait (pthread_barrier_t *barrier)
     {
       barrier->__pending = barrier->__count;
 
-      if (barrier->__count > 1)
+      if (barrier->__count == 1)
+       __pthread_spin_unlock (&barrier->__lock);
+      else
        {
          struct __pthread *wakeup;
          unsigned n = 0;