pthread_condattr_getpshared()--Get Process Shared Attribute from Condition Attributes Object


  Syntax:
 #include <pthread.h>
 int pthread_condattr_getpshared(const pthread_condattr_t *attr, int *pshared);  
  Service Program Name: QP0WPTHR

  Default Public Authority: *USE

  Threadsafe: Yes

  Signal Safe: Yes

The pthread_condattr_getpshared() function retrieves the current setting of the process shared attribute from the condition attributes object. The process shared attribute indicates whether the condition that is created using the condition attributes object can be shared between threads in separate processes (PTHREAD_PROCESS_SHARED) or shared only between threads within the same process (PTHREAD_PROCESS_PRIVATE).

Even if the condition in storage is accessible from two separate processes, it cannot be used from both processes unless the process shared attribute is PTHREAD_PROCESS_SHARED.

The default pshared attribute for condition attributes objects is PTHREAD_PROCESS_PRIVATE.


Authorities and Locks

None.


Parameters

attr
(Input) Address of the variable that contains the condition attributes object
pshared
(Output) Address of the variable to contain the pshared attribute result

Return Value

0
pthread_condattr_getpshared() was successful.
value
pthread_condattr_getpshared() was not successful. value is set to indicate the error condition.

Error Conditions

If pthread_condattr_getpshared() was not successful, the error condition returned usually indicates one of the following errors. Under some conditions, the value returned could indicate an error other than those listed here.

[EINVAL]

The value specified for the argument is not correct.


Related Information


Example

See Code disclaimer information for information pertaining to code examples.

See the example for pthread_condattr_setpshared().


API introduced: V4R3
Top | Pthread APIs | APIs by category