From 067bdc2c180885af831f55f971f5eb17d2c9dc27 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Tue, 27 Sep 2011 23:08:59 -0400 Subject: [PATCH] correctly handle the degenerate barrier in the pshared case --- src/thread/pthread_barrier_wait.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/thread/pthread_barrier_wait.c b/src/thread/pthread_barrier_wait.c index 83c32ca3..a97f6d56 100644 --- a/src/thread/pthread_barrier_wait.c +++ b/src/thread/pthread_barrier_wait.c @@ -24,7 +24,7 @@ static int pshared_barrier_wait(pthread_barrier_t *b) int seq; int ret = 0; - if (!limit) return PTHREAD_BARRIER_SERIAL_THREAD; + if (limit==1) return PTHREAD_BARRIER_SERIAL_THREAD; while (a_swap(&b->_b_lock, 1)) __wait(&b->_b_lock, &b->_b_waiters, 1, 0); -- 2.25.1