pthread_mutexattr_getpshared(3) | Library Functions Manual | pthread_mutexattr_getpshared(3) |
pthread_mutexattr_getpshared, pthread_mutexattr_setpshared - get/set process-shared mutex attribute
POSIX threads library (libpthread, -lpthread)
#include <pthread.h>
int pthread_mutexattr_getpshared( const pthread_mutexattr_t *restrict attr, int *restrict pshared); int pthread_mutexattr_setpshared(pthread_mutexattr_t *attr, int pshared);
These functions get and set the process-shared attribute in a mutex attributes object. This attribute must be appropriately set to ensure correct, efficient operation of a mutex created using this attributes object.
The process-shared attribute can have one of the following values:
pthread_mutexattr_getpshared() places the value of the process-shared attribute of the mutex attributes object referred to by attr in the location pointed to by pshared.
pthread_mutexattr_setpshared() sets the value of the process-shared attribute of the mutex attributes object referred to by attr to the value specified in pshared.
If attr does not refer to an initialized mutex attributes object, the behavior is undefined.
On success, these functions return 0. On error, they return a positive error number.
pthread_mutexattr_setpshared() can fail with the following errors:
POSIX.1-2008.
POSIX.1-2001.
pthread_mutexattr_init(3), pthreads(7)
2023-10-31 | Linux man-pages 6.7 |