bar_wait(3) Library Functions Manual bar_wait(3) NAME bar_wait – wait at thread barrier SYNOPSIS library “threads†#include <threadse.h> int bar_wait(bar_t *barrier); DESCRIPTION The function bar_wait() will stall stop the current thread and wait until the correct amount of threads are waiting at the given thread barrier, as specified at the initialization of the barrier in bar_init(3). RETURN VALUES Upon success bar_wait() will return thrd_success for exactly one thread and thrd_busy for all others. In case of an error thrd_error will be returned. SEE ALSO bar_init(3) bar_destroy(3) HISTORY The bar_wait() function first appeared in the Adelsbach Enhanced Threading Library. MacOS support was added in version 1.0.1 due to the lack of native MacOS support for thread barriers the implementation manually implements this using mutexes and condition variables. AUTHORS Jan Adelsbach <jan@jadelsbach.de> Linux 6.13.6-1-default March 30, 2025 Linux 6.13.6-1-default