Skip to content

posix: implement pthread_barrierattr_getpshared() #59937

@ycsin

Description

@ycsin

There are currently 20 missing POSIX functions with trivial implementations, pthread_barrierattr_getpshared() is one of them.

pthread_barrierattr_getpshared, pthread_barrierattr_setpshared - get and set the process-shared attribute of the barrier attributes object

The pthread_barrierattr_getpshared() function shall obtain the value of the process-shared attribute from the attributes object referenced by attr. The pthread_barrierattr_setpshared() function shall set the process-shared attribute in an initialized attributes object referenced by attr.

The process-shared attribute is set to PTHREAD_PROCESS_SHARED to permit a barrier to be operated upon by any thread that has access to the memory where the barrier is allocated. See Synchronization Object Copies and Alternative Mappings for further requirements. The default value of the attribute shall be PTHREAD_PROCESS_PRIVATE. Both constants PTHREAD_PROCESS_SHARED and PTHREAD_PROCESS_PRIVATE are defined in <pthread.h>.

Additional attributes, their default values, and the names of the associated functions to get and set those attribute values are implementation-defined.

The behavior is undefined if the value specified by the attr argument to pthread_barrierattr_getpshared() or pthread_barrierattr_setpshared() does not refer to an initialized barrier attributes object.

See https://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_barrierattr_getpshared.html

See RFC #51211 for more info.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Feature RequestA request for a new featureGood first issueGood for a first time contributor to takearea: POSIXPOSIX API Library

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions