Adelsbach Enhanced Threading Library

Manual Pages (DD-00013-001)

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

rwmtx_tryrdlockattempt to acquire a read lock

library “threads”
#include <threadse.h>

int
rwmtx_tryrdlock(rwmtx_t *rw);

The function () will attempt to acquire a read lock on the given read/write lock rw. If a read lock cannot be acquired the function will return a respective return code.

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

Upon success rwmtx_tryrdlock() will return thrd_success if a read lock has been acquired. If no read lock can be acquired at this time thrd_busy 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_timedrdlock(3) rwmtx_timedwrlock(3) rwmtx_unlock(3)

The rwmtx_tryrdlock() function first appeared in the Adelsbach Enhanced Threading Library.

Jan Adelsbach <jan@jadelsbach.de>

May 9, 2020 Debian