*nix Documentation Project
·  Home
 +   man pages
·  Linux HOWTOs
·  FreeBSD Tips
·  *niX Forums

  man pages->IRIX man pages -> pthread_rwlock_rdlock (3p)              


pthread_rwlock_rdlock(3P)			     pthread_rwlock_rdlock(3P)

NAME    [Toc]    [Back]

     pthread_rwlock_rdlock, pthread_rwlock_tryrdlock - lock a read-write lock
     object for	reading

C SYNOPSIS    [Toc]    [Back]

     #include <pthread.h>

     int pthread_rwlock_rdlock(pthread_rwlock_t	*rwlock);

     int pthread_rwlock_tryrdlock(pthread_rwlock_t *rwlock);

DESCRIPTION    [Toc]    [Back]

     Read-write	locks allow a thread to	exclusively lock some shared data
     while updating that data, or allow	any number of threads to have
     simultaneous read-only access to the data.	 The pthread_rwlock_rdlock()
     and pthread_rwlock_tryrdlock() functions apply a read lock	to the readwrite
 lock	object referenced by rwlock.  The calling thread will only
     acquire the lock if a writer does not own the lock.  A thread that	calls
     pthread_rwlock_rdlock() will block	until it can gain the read-write lock
     for reading, and retains ownership	until it calls
     pthread_rwlock_unlock().  Only the	thread that locked a read-write	lock
     should unlock it.	When unlocked, if there	are both readers and writers
     of	the same priority waiting for the read-write lock, writers will	be
     scheduled before readers.

     A single thread may hold recursive	read locks on a	read-write lock.  In
     this case there must be a matching	number of unlocks by the thread	before
     the read-write lock can be	released.

     If	a thread waiting for a read-write lock receives	a signal, upon return
     from the signal handler, the thread resumes waiting for the read-write
     lock as if	there was no interrupt.

DIAGNOSTICS    [Toc]    [Back]

     All of the	read-write lock	functions return zero if successful;
     otherwise,	an error number	is returned.

     pthread_rwlock_tryrdlock()	can return the following error:

     [EBUSY]	    The	read-write lock	is currently held by a writer.

SEE ALSO    [Toc]    [Back]

     pthread_rwlock_init(3P), pthread_rwlock_wrlock(3P),
     pthread_rwlock_unlock(3P),	pthread_rwlockattr_init(3P),

									PPPPaaaaggggeeee 1111
[ Back ]
 Similar pages
Name OS Title
pthread_rwlock_wrlock IRIX lock a read-write lock object for writing
pthread_rwlock_tryrdlock FreeBSD acquire a read/write lock for reading
pthread_rwlock_tryrdlock OpenBSD acquire a read/write lock for reading
pthread_rwlock_rdlock FreeBSD acquire a read/write lock for reading
pthread_rwlock_rdlock OpenBSD acquire a read/write lock for reading
tis_read_trylock Tru64 Attempts to acquire a read-write lock for read access and does not wait if the lock cannot be immedi...
tis_rwlock_init Tru64 Initializes a read-write lock object
tis_rwlock_destroy Tru64 Destroys the specified read-write lock object
pthread_rwlock_unlock IRIX unlock a read-write lock object
pthread_rwlock_destroy Tru64 Destroys a read-write lock object
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service