SYNOPSIS
#include <pthread.h>
int pthread_barrierattr_getpshared(const pthread_barrierattr_t *restrict attr, int *restrict pshared);
int pthread_barrierattr_setpshared(pthread_barrierattr_t *attr, int pshared);
DESCRIPTION
The
Valid settings for the process-shared attribute include
- PTHREAD_PROCESS_SHARED
-
Permits any thread that can access the memory where a barrier is allocated to operate on that barrier.
- PTHREAD_PROCESS_PRIVATE
-
Permits only threads created within the same process as the thread that initialized a barrier to operate on that barrier.
By default, the process-shared attribute is set to PTHREAD_PROCESS_PRIVATE. Both constants PTHREAD_PROCESS_SHARED and PTHREAD_PROCESS_PRIVATE are defined in <pthread.h>.
PARAMETERS
- attr
-
Points to a barrier attributes object.
- pshared
-
For the
pthread_barrier_getpshared() , this argument points to the location where the value of the process-shared attribute of attr is stored.For the
pthread_barrier_setpshared() , this argument is the value to be assigned to the process-shared attribute of attr is stored.
RETURN VALUES
When successful, the
When successful, the
The error number returned by these functions can be one of the following:
- EINVAL
-
The attr argument points to an invalid value or the new value specified for the process-shared attribute is not PTHREAD_PROCESS_SHARED or PTHREAD_PROCESS_PRIVATE.
- ENOTSUP
-
The pshared argument was set to PTHREAD_PROCESS_SHARED.
CONFORMANCE
UNIX 03.
MULTITHREAD SAFETY LEVEL
MT-safe.
PORTING ISSUES
The PTHREAD_PROCESS_SHARED process-shared state is not currently supported; if this value is specified, the function returns ENOTSUP.
AVAILABILITY
PTC MKS Toolkit for Professional Developers
PTC MKS Toolkit for Professional Developers 64-Bit Edition
PTC MKS Toolkit for Enterprise Developers
PTC MKS Toolkit for Enterprise Developers 64-Bit Edition
SEE ALSO
PTC MKS Toolkit 10.5 Documentation Build 40.