Index of Section 2 Manual Pages
| Interix / SUA | pthread_mutexattr_getpshared.2 | Interix / SUA |
pthread_mutexattr_getpshared(2) pthread_mutexattr_getpshared(2)
pthread_mutexattr_getpshared()
NAME
pthread_mutexattr_getpshared(), pthread_mutexattr_setpshared() - get or
set the process-shared attribute in a mutex attributes object
SYNOPSIS
#include
int pthread_mutexattr_getpshared(const pthread_mutexattr_t *attr,
int *pshared);
int pthread_mutexattr_setpshared(pthread_mutexattr_t *attr,
int pshared);
DESCRIPTION
The pthread_mutexattr_setpshared(2) function sets the process-shared
attribute in the mutex attributes object referenced by the attr argument
to the value specified in the pshared argument. When the process-shared
attribute is set to PTHREAD_PROCESS_SHARED, the mutex can be acted upon by
any thread that can access the memory where the mutex is stored, even if
the mutex is allocated in memory shared by multiple processes. When the
process-shared attribute is set to PTHREAD_PROCESS_PRIVATE (the default),
the mutex can be acted upon only by threads that have been created in the
same process as the thread that initialized the mutex.
The pthread_mutexattr_getpshared(2) function retrieves the process-shared
attribute in the mutex attributes object referenced by attr, storing the
value in the location referenced by the pshared argument.
IMPLEMENTATION ISSUES
In this version of Interix, this function supports only the
PTHREAD_PROCESS_PRIVATE process-shared attribute.
RETURN VALUES
On success, both functions return 0; otherwise, an error code is returned.
ERRORS
Both functions can fail for the following reasons:
[EINVAL]
The attr argument is invalid, or the pshared argument is out of range.
This function does not return [EINTR].
SEE ALSO
pthread_cond_destroy(2)
pthread_create(2)
pthread_mutex_destroy(2)
pthread_mutexattr_destroy(2)
USAGE NOTES
All of these functions are thread safe.
None of these functions are async-signal safe.