libroot: Implemented pthread barriers

This is an implementation of pthread barriers pursuant to the relevant specification.

Barriers are essentially a special case of conditional variables,
such that all threads waiting on one are woken up when the number of
waiters reaches a number provided at the initialization of the barrier.
In view of that, this implementation mimics the implementation of pthread_cond,
except it is more specialized and self-contained.

Signed-off-by: Jérôme Duval <[email protected]>
This commit is contained in:
Dmytro Shynkevych
2016-12-30 11:32:04 +01:00
committed by Jérôme Duval
parent efd1e1eee8
commit 0e0f49e799
7 changed files with 238 additions and 4 deletions
@@ -37,6 +37,10 @@ typedef struct _pthread_mutexattr {
bool process_shared;
} pthread_mutexattr;
typedef struct _pthread_barrierattr {
bool process_shared;
} pthread_barrierattr;
typedef struct _pthread_attr {
int32 detach_state;
int32 sched_priority;