Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
PTHREAD_BARRIER_INI... FreeBSD Library Functions Manual	PTHREAD_BARRIER_INI...

NAME
     pthread_barrier_init, pthread_barrier_destroy -- initialize and destroy a
     barrier object

SYNOPSIS
     #include <pthread.h>

     int
     pthread_barrier_init(pthread_barrier_t *barrier,
	 pthread_barrierattr_t *attr, unsigned int count);

     int
     pthread_barrier_destroy(pthread_barrier_t *barrier);

DESCRIPTION
     The pthread_barrier_init()	function creates a new barrier object, with
     attributes	specified with attr and	with a threshold specified with	count.
     If	attr is	NULL the default attributes are	used.  The count argument is
     later used	by the pthread_barrier_wait() function to check	if the re-
     quired number of threads reached the barrier.

     The pthread_barrier_destroy() function frees the resources	allocated for
     barrier.

RETURN VALUES
     If	successful, pthread_barrier_init() and pthread_barrier_destroy() re-
     turn zero;	otherwise an error number is returned to indicate the error.

ERRORS
     pthread_barrier_init() will fail if:

     [EINVAL]		The value specified by barrier or attr is invalid.

     [ENOMEM]		The process cannot allocate enough memory to create
			another	barrier	object.

     [ENOTSUP]		The attributes specified by attr are not supported by
			the current implementation.

     pthread_barrier_destroy() will fail if:

     [EINVAL]		The value specified by barrier is invalid.

     [EBUSY]		There are still	threads	waiting	on the barrier.

SEE ALSO
     pthread_barrier_wait(3), pthread_barrierattr_getpshared(3),
     pthread_barrierattr_init(3)

STANDARDS
     pthread_barrier_init() and	pthread_barrier_destroy() conform to IEEE Std
     1003.1-2008 ("POSIX.1").

BUGS
     Currently only private barriers are supported and the pshared attribute
     is	always set that	way.  Any attempts to change that value	will trigger
     ENOTSUP.

FreeBSD	13.0			 April 6, 2020			  FreeBSD 13.0

NAME | SYNOPSIS | DESCRIPTION | RETURN VALUES | ERRORS | SEE ALSO | STANDARDS | BUGS

Want to link to this manual page? Use this URL:
<https://www.freebsd.org/cgi/man.cgi?query=pthread_barrier_init&sektion=3&manpath=OpenBSD+6.9>

home | help