This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
[hurd,commited 09/10] htl: Fix barrier_wait with one thread
- From: Samuel Thibault <samuel dot thibault at ens-lyon dot org>
- To: libc-alpha at sourceware dot org
- Cc: Samuel Thibault <samuel dot thibault at ens-lyon dot org>, commit-hurd at gnu dot org
- Date: Mon, 10 Feb 2020 02:05:07 +0100
- Subject: [hurd,commited 09/10] htl: Fix barrier_wait with one thread
- References: <20200210010508.428251-1-samuel.thibault@ens-lyon.org>
---
sysdeps/htl/pt-barrier-wait.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/sysdeps/htl/pt-barrier-wait.c b/sysdeps/htl/pt-barrier-wait.c
index 47ec440b26..146605abd8 100644
--- a/sysdeps/htl/pt-barrier-wait.c
+++ b/sysdeps/htl/pt-barrier-wait.c
@@ -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;
--
2.24.1