Attempts to acquire a readers/writer lock in read access mode. Does
not wait if the lock cannot be immediately granted.
Syntax
tis_read_trylock(
lock );
Argument Data Type Access
lock opaque tis_rwlock_t write
C Binding
#include
int
tis_read_trylock (
tis_rwlock_t *lock);
Arguments
- lock
- Address of the readers/writer lock.
Description
This routine attempts to acquire a readers/writer lock in
read access mode. If the lock cannot be granted, the routine returns
without waiting. When a thread calls this routine, an attempt is
made to immediately acquire the lock in read mode. If the lock is
acquired, 0 is returned. If a write access mode lock holder exists,
EBUSY is returned. If the lock cannot be obtained immediately, the
calling program does not wait for the lock to be released.
Return Values
If an error condition occurs, this routine returns an integer value
indicating the type of error. Possible return values are as follows:
Return Description
0 Successful completion; the lock was acquired.
[EBUSY] The lock is being held with write access mode. The
lock was not acquired.
Associated Routines
tis_read_lock
tis_read_unlock
tis_rwlock_destroy
tis_rwlock_init
tis_write_lock
tis_write_trylock
tis_write_unlock