Skip to content

[libc] add pthread_rwlock_clockrdlock and pthread_rwlock_clockwrlock GNU extensions #99697

@SchrodingerZhu

Description

@SchrodingerZhu

Function: int pthread_rwlock_clockrdlock (pthread_rwlock_t *rwlock, clockid_t clockid, const struct timespec *abstime)
Preliminary: | MT-Safe | AS-Unsafe lock | AC-Unsafe lock | See POSIX Safety Concepts.
Behaves like pthread_rwlock_timedrdlock except the time abstime is measured against the clock specified by clockid rather than CLOCK_REALTIME. Currently, clockid must be either CLOCK_MONOTONIC or CLOCK_REALTIME, otherwise EINVAL is returned.

Function: int pthread_rwlock_clockwrlock (pthread_rwlock_t *rwlock, clockid_t clockid, const struct timespec *abstime)
Preliminary: | MT-Safe | AS-Unsafe lock | AC-Unsafe lock | See POSIX Safety Concepts.
Behaves like pthread_rwlock_timedwrlock except the time abstime is measured against the clock specified by clockid rather than CLOCK_REALTIME. Currently, clockid must be either CLOCK_MONOTONIC or CLOCK_REALTIME, otherwise EINVAL is returned.

These should be easy to do since we already have all the abilities to handle realtime and monolithic clocks. See:

internal::AbsTimeout::from_timespec(*abstime, /*is_realtime=*/true);

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions