f_pthread_rwlock_tryrdlock(rwlock)

Purpose

This function applies a read lock like the f_pthread_rwlock_rdlock function with the exception that the function fails if any thread holds a write lock on rwlock or there are writers blocked on rwlock. In that case, the function returns EBUSY. The calling thread can check the return code to take further actions.

Class

Function

Argument Type and Attributes

rwlock
TYPE(f_pthread_rwlock_t), INTENT(INOUT)

Result Type and Attributes

INTEGER(4)

Result Value

This function returns zero if the lock for reading on the read-write lock object specified by rwlock is acquired. Otherwise, the following error will be returned:

EBUSY
The read-write lock could not be acquired for reading because a writer holds the lock or was blocked on it.
IBM Copyright 2003