From f3a7ff069f74e4d6a89aba5fb9bba74f38d249c7 Mon Sep 17 00:00:00 2001 From: Samuel Thibault Date: Sun, 9 Feb 2020 23:02:13 +0000 Subject: htl: Fix barrier_wait with one thread --- sysdeps/htl/pt-barrier-wait.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'sysdeps/htl/pt-barrier-wait.c') 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; -- cgit 1.4.1