pthread_rwlock_attr.h

Implementation of a fair, POSIX conforming reader/writer lock (attribute set).

Note

Do not include this header file directly, but pthread.h.

int pthread_rwlockattr_init(pthread_rwlockattr_t * attr)

Initilize the attribute set with the defaults.

Default value for pshared: PTHREAD_PROCESS_PRIVATE. A zeroed out datum is initialized.

Parameters

attr:Attribute set to initialize.

Return values

  • 0 on success. EINVAL if attr == NULL.
int pthread_rwlockattr_destroy(pthread_rwlockattr_t * attr)

Destroy an attribute set.

This function does nothing, don’t bother calling it.

Parameters

attr:Attribute set to destroy.

Return values

  • 0 on success. EINVAL if attr == NULL.
int pthread_rwlockattr_getpshared(const pthread_rwlockattr_t * attr, int * pshared)

Read whether to share the lock with child processes.

There are not child processes in RIOT.

Parameters

attr:Attribute set to query.
pshared:Either PTHREAD_PROCESS_SHARED or PTHREAD_PROCESS_PRIVATE.

Return values

  • 0 on success. EINVAL if attr == NULL.
int pthread_rwlockattr_setpshared(pthread_rwlockattr_t * attr, int pshared)

Set whether to share the lock with child processes.

There are not child processes in RIOT.

Parameters

attr:Attribute set to operate on.
pshared:Either PTHREAD_PROCESS_SHARED or PTHREAD_PROCESS_PRIVATE.

Return values

  • 0 on success. EINVAL if attr == NULL or a wrong value for pshared was supplied.
struct pthread_rwlockattr_t

Attributes for a new reader/writer lock.

The options set in this struct will be ignored by pthread_rwlock.h::pthread_rwlock_init().

int pshared

Whether to share lock with child processes.

Valid values are PTHREAD_PROCESS_SHARED and PTHREAD_PROCESS_PRIVATE. Since RIOT is a single-process operating system, this value is ignored.