summaryrefslogtreecommitdiff
path: root/pthread_barrier_init.c
diff options
context:
space:
mode:
authorrpj <rpj>2010-06-20 03:31:18 +0000
committerrpj <rpj>2010-06-20 03:31:18 +0000
commita3ea0b24409b89bd08c0a2268dbae834724734df (patch)
tree4629fd085756226f0cee8beba4faf66466ef0410 /pthread_barrier_init.c
parent135d6f060c5e5232311af77bd0d0f500e861290c (diff)
See ChangeLogs: preparing for new release.
Diffstat (limited to 'pthread_barrier_init.c')
-rw-r--r--pthread_barrier_init.c16
1 files changed, 2 insertions, 14 deletions
diff --git a/pthread_barrier_init.c b/pthread_barrier_init.c
index dc1b50c..618bfae 100644
--- a/pthread_barrier_init.c
+++ b/pthread_barrier_init.c
@@ -55,25 +55,13 @@ pthread_barrier_init (pthread_barrier_t * barrier,
? (*attr)->pshared : PTHREAD_PROCESS_PRIVATE);
b->nCurrentBarrierHeight = b->nInitialBarrierHeight = count;
- b->iStep = 0;
+ b->lock = 0;
- /*
- * Two semaphores are used in the same way as two stepping
- * stones might be used in crossing a stream. Once all
- * threads are safely on one stone, the other stone can
- * be moved ahead, and the threads can start moving to it.
- * If some threads decide to eat their lunch before moving
- * then the other threads have to wait.
- */
- if (0 == sem_init (&(b->semBarrierBreeched[0]), b->pshared, 0))
- {
- if (0 == sem_init (&(b->semBarrierBreeched[1]), b->pshared, 0))
+ if (0 == sem_init (&(b->semBarrierBreeched), b->pshared, 0))
{
*barrier = b;
return 0;
}
- (void) sem_destroy (&(b->semBarrierBreeched[0]));
- }
(void) free (b);
}