summaryrefslogtreecommitdiff
path: root/nptl/pthread_barrier_wait.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2007-08-01 17:16:42 +0000
committerJakub Jelinek <jakub@redhat.com>2007-08-01 17:16:42 +0000
commite08057b1ff24258dd7460ad81e84491f7a28b424 (patch)
treef63a12d52cbc1796013a84382fe25f57ac675204 /nptl/pthread_barrier_wait.c
parent4baf42dd00e8cafc79e2a3c94ef8effa6ef0a921 (diff)
downloadglibc-e08057b1ff24258dd7460ad81e84491f7a28b424.tar
glibc-e08057b1ff24258dd7460ad81e84491f7a28b424.tar.gz
glibc-e08057b1ff24258dd7460ad81e84491f7a28b424.tar.bz2
glibc-e08057b1ff24258dd7460ad81e84491f7a28b424.zip
Updated to fedora-glibc-20070801T1703cvs/fedora-glibc-2_6_90-2
Diffstat (limited to 'nptl/pthread_barrier_wait.c')
-rw-r--r--nptl/pthread_barrier_wait.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/nptl/pthread_barrier_wait.c b/nptl/pthread_barrier_wait.c
index e96a3e5473..9d80cad902 100644
--- a/nptl/pthread_barrier_wait.c
+++ b/nptl/pthread_barrier_wait.c
@@ -32,7 +32,7 @@ pthread_barrier_wait (barrier)
int result = 0;
/* Make sure we are alone. */
- lll_lock (ibarrier->lock);
+ lll_lock (ibarrier->lock, ibarrier->private ^ FUTEX_PRIVATE_FLAG);
/* One more arrival. */
--ibarrier->left;
@@ -46,8 +46,7 @@ pthread_barrier_wait (barrier)
/* Wake up everybody. */
lll_futex_wake (&ibarrier->curr_event, INT_MAX,
- // XYZ check mutex flag
- LLL_SHARED);
+ ibarrier->private ^ FUTEX_PRIVATE_FLAG);
/* This is the thread which finished the serialization. */
result = PTHREAD_BARRIER_SERIAL_THREAD;
@@ -59,13 +58,12 @@ pthread_barrier_wait (barrier)
unsigned int event = ibarrier->curr_event;
/* Before suspending, make the barrier available to others. */
- lll_unlock (ibarrier->lock);
+ lll_unlock (ibarrier->lock, ibarrier->private ^ FUTEX_PRIVATE_FLAG);
/* Wait for the event counter of the barrier to change. */
do
lll_futex_wait (&ibarrier->curr_event, event,
- // XYZ check mutex flag
- LLL_SHARED);
+ ibarrier->private ^ FUTEX_PRIVATE_FLAG);
while (event == ibarrier->curr_event);
}
@@ -75,7 +73,7 @@ pthread_barrier_wait (barrier)
/* If this was the last woken thread, unlock. */
if (atomic_increment_val (&ibarrier->left) == init_count)
/* We are done. */
- lll_unlock (ibarrier->lock);
+ lll_unlock (ibarrier->lock, ibarrier->private ^ FUTEX_PRIVATE_FLAG);
return result;
}