Adelsbach Enhanced Threading Library Version 1.0.1

Manual Pages (DD-00013-002)

Enhanced Threading Library > bar_wait (3)
HTML TXT PDF PS
bar_wait(3) Library Functions Manual bar_wait(3)

bar_waitwait at thread barrier

library “threads”
#include <threadse.h>

int
bar_wait(bar_t *barrier);

The function () 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).

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.

bar_init(3) bar_destroy(3)

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.

Jan Adelsbach <jan@jadelsbach.de>

March 30, 2025 Linux 6.13.6-1-default