[Return to Bookshelf] [Contents] [Previous Section] [Next Section] [Index] [Help]


tis_read_lock

Acquires a readers/writer lock in read access mode.

Syntax

tis_read_lock(
              lock );
 


Argument Data Type Access

lock opaque tis_rwlock_t write


C Binding

#include 

int tis_read_lock ( tis_rwlock_t *lock);

Arguments

lock
Address of the readers/writer lock.

Description

This routine acquires a readers/writer lock in read access mode. This routine waits for any existing write access mode lock holder to relinquish its lock before granting the lock in read access mode. It returns when the lock is acquired. If the lock is already held in read access mode, the lock is granted.

For each call to tis_read_lock that successfully acquires the lock in read access mode, a corresponding call tis_read_unlock must be issued.

Note that the type tis_rwlock_p is a pointer to type tis_rwlock_t.

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. [EINVAL] The value specified by lock is invalid.


Associated Routines

   tis_read_trylock
   tis_read_unlock
   tis_rwlock_destroy
   tis_rwlock_init
   tis_write_lock
   tis_write_trylock
   tis_write_unlock



[Return to Bookshelf] [Contents] [Previous Section] [Next Section] [Index] [Help]