pthread_condattr_setpshared()

set the process-shared condition variable attributes 

Function


SYNOPSIS

#include <pthread.h>

int pthread_condattr_setpshared(pthread_condattr_t *attr, int pshared);


DESCRIPTION

The pthread_condattr_setpshared() function sets the process-shared state attribute in the specified condition variable attribute object. The condition variable's process-shared state determines whether the condition variable can be used to synchronize threads within the current process or threads within all processes on the system. Valid settings for pshared include:

PTHREAD_PROCESS_PRIVATE  

Creates a condition variable that can only be used to synchronize threads within the current process.

PTHREAD_PROCESS_SHARED  

Creates a condition variable that can be used to synchronize threads within all processes on the system


PARAMETERS

attr 

Is a condition variable attribute object.

pshared 

Is the condition variable process-shared state attribute value; one of the values specified in the DESCRIPTION section.


RETURN VALUES

On success, pthread_condattr_setpshared() returns 0. On error, one of the following values is returned:

EINVAL 

attr is not an initialized condition variable attribute object, or pshared is not a valid process-shared state setting.

EFAULT 

attr is an invalid pointer.

ENOTSUP 

pshared was set to PTHREAD_PROCESS_SHARED.


CONFORMANCE

POSIX P1003.1 (1996)


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

Functions:
pthread_cond_init(), pthread_condattr_getpshared(), pthread_condattr_init()


PTC MKS Toolkit 10.4 Documentation Build 39.