Adelsbach Enhanced Threading Library Version 1.0.1

Manual Pages (DD-00013-002)

Enhanced Threading Library > rwmtx_timedrdlock (3)
HTML TXT PDF PS
rwmtx_timedrdlock(3) Library Functions Manual rwmtx_timedrdlock(3)

rwmtx_timedrdlockattempt to acquire a read lock with timeout

library “threads”
#include <threadse.h>

int
rwmtx_timedrdlock(rwmtx_t *rw, const struct timespec *ts);

The function () will acquire a timed read lock on the given rw. If the lock can not be acquired at this time the function will wait up to time time specified by ts before giving up.

A thread can hold multiple read locks at the same time, rwmtx_unlock(3) must be called for each acquired lock.

Upon success rwmtx_timedrdlock() will return thrd_success if the lock could not be acquired in time thrd_timeout will be returned. In case of error thrd_error will be returned.

rwmtx_init(3) rwmtx_destroy(3) rwmtx_rdlock(3) rwmtx_wrlock(3) rwmtx_trywrlock(3) rwmtx_tryrdlock(3) rwmtx_timedwrlock(3) rwmtx_unlock(3)

The rwmtx_timedrdlock() function first appeared in the Adelsbach Enhanced Threading Library. Support for MacOS was added in the Adelsbach Threading Library 1.0.1, the behaivor of the timed lock is emulated due to lack of native MacOS support.

Jan Adelsbach <jan@jadelsbach.de>

March 30, 2025 Linux 6.13.6-1-default