Set the value of a barrier's process-shared attribute
#include <sync.h>
int pthread_barrierattr_setpshared(
pthread_barrierattr_t * attr
int pshared );
libc
The pthread_barrierattr_setpshared() function sets the
process-shared attribute in an initialized attributes object
referenced by attr. The process-shared attribute can have
one of two values:
- PTHREAD_PROCESS_SHARED
- Allow a barrier to be operated upon by any thread that
has access to the memory where the barrier is allocated.
- PTHREAD_PROCESS_PRIVATE (default behavior).
- A barrier is operated upon only by threads created within the same process as the thread
that initialized the barrier. If threads of different processes attempt
to operate on such a barrier, the behavior is as if
PTHREAD_PROCESS_SHARED is set.
- EOK
- Success.
- EINVAL
- Invalid mutex attribute object attr.
- EINVAL
- The new value specified in pshared isn't
PTHREAD_PROCESS_SHARED or
PTHREAD_PROCESS_PRIVATE.
POSIX 1003.1j (draft)
Safety: | |
Cancellation point |
No |
Interrupt handler |
No |
Signal handler |
Yes |
Thread |
Yes |
pthread_barrier_init()
pthread_barrierattr_destroy(),
pthread_barrierattr_getpshared(),
pthread_barrierattr_init()