_barrier_spin_init(3synch) _barrier_spin_init(3synch)
NAME
_barrier_spin_init - initialize a spinning barrier
SYNOPSIS
cc [options] -Kthread file
#include <synch.h>
int _barrier_spin_init(barrier_spin_t *barrier, int count, void *arg);
Parameters
barrier
pointer to barrier to be initialized
count number of threads to use the barrier for
synchronization
arg NULL (reserved for future use)
DESCRIPTION
_barrier_spin_init initializes the spinning barrier pointed to
by barrier to synchronize count threads. Once initialized,
the barrier can be used any number of times without being re-
initialized, to synchronize execution of count threads.
Threads waiting at a spinning barrier will busy-wait, or spin,
until all count threads arrive at the barrier.
barrier Parameter
barrier points to the spinning barrier to be initialized.
count Parameter
count is the number of threads that will be synchronized by
the barrier. That is, any threads calling _barrier_spin will
spin until count threads have reached the barrier.
arg Parameter
arg should be set to NULL. It is not currently used, but is
reserved for future use.
Return Values
_barrier_spin_init returns zero for success and an error
number for failure, as described below.
Errors
If one of the following conditions is detected,
_barrier_spin_init returns the corresponding value:
Copyright 1994 Novell, Inc. Page 1
_barrier_spin_init(3synch) _barrier_spin_init(3synch)
EINVAL Invalid argument specified.
USAGE
Warnings
A barrier should not be re-initialized while threads are
spinning at the barrier.
REFERENCES
_barrier_spin(3synch), _barrier_spin_destroy(3synch),
barrier(3synch), barrier_destroy(3synch),
barrier_init(3synch), barrier_wait(3synch), synch(3synch)
Copyright 1994 Novell, Inc. Page 2