barrier_init

Initializes a blocking barrier.

Library:LibC
Classification:UNIX International
Service:Synchronization

Syntax

  #include <synch.h>
   
  int  barrier_init (
     barrier_t   *bp,
     int          threads );
  

Parameters

bp

(IN) Points to the barrier to be initialized.

threads

(IN) Specifies the number of threads that must reach the barrier.

Return Values

If successful, returns zero; otherwise, returns -1 and sets errno to one of the following:

Decimal

Constant

Description

5

ENOMEM

Insufficient memory to create the barrier.

105

ENOCONTEXT

The calling thread has no context.

Remarks

A barrier should not be reinitialized with the barrier_init function when threads are waiting on the barrier.

See Also