Skip to main content

pthread_barrier_init

Function pthread_barrier_init 

Source
#[unsafe(no_mangle)]
pub unsafe extern "C" fn pthread_barrier_init( barrier: *mut pthread_barrier_t, attr: *const pthread_barrierattr_t, count: c_uint, ) -> c_int
Expand description

See https://pubs.opengroup.org/onlinepubs/9799919799/functions/pthread_barrier_init.html.

Allocates any resources required to use the barrier referenced by barrier and shall initialize the barrier with attributes referenced by attr.

Upon success, returns 0. Upon error, returns an error number.

§Implementation

Not async-signal-safe.

§Safety

The following will result in undefined behaviour:

  • Use of barrier before this function is called.
  • This function is called with an already initialized barrier.
  • This function is called when any thread is blocked on barrier.