pthread_condattr_getpshared()

QNX SDP8.0C Library ReferenceAPIDeveloper

Get the process-shared attribute from a condition variable attribute object

Synopsis:

#include <pthread.h>

int pthread_condattr_getpshared( 
            const pthread_condattr_t* attr,
            int* pshared );

Arguments:

attr
A pointer to the pthread_condattr_t object from which you want to get the attribute.
pshared
A pointer to a location where the function can store the process-shared attribute.

Library:

libc

Use the -l c option to qcc to link against this library. This library is usually included automatically.

Description:

The pthread_condattr_getpshared() function stores, in the memory pointed to by pshared, the process-shared attribute from a condition variable attribute object, attr. The possible values are:

  • PTHREAD_PROCESS_SHARED — any thread that has access to the memory where the condition variable is allocated can operate on it, even if the condition variable is allocated in memory that's shared by multiple processes.
  • PTHREAD_PROCESS_PRIVATE — the condition variable can be accessed only by threads created within the same process as the thread that initialized the condition variable; if threads from other processes try to access the PTHREAD_PROCESS_PRIVATE condition variable, the behavior is undefined.

Returns:

EOK
Success.
EINVAL
Invalid condition variable attribute object specified by attr.

Classification:

POSIX 1003.1 TSH

Safety:
Cancellation pointNo
Signal handlerYes
ThreadYes
Page updated: