DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 

rw_unlock(SYNCH)


rw_unlock -- release a reader-writer lock

Synopsis

   cc [options] -Kthread file
   

#include <synch.h>

int rw_unlock(rwlock_t *lock);

Description

rw_unlock releases a reader-writer lock previously acquired by rw_rdlock, rw_wrlock, rw_tryrdlock, or rw_trywrlock. The behavior differs according to whether the caller is a reader or a writer:

When rw_unlock unlocks the lock, the first waiter (reader or writer) is activated.

lock must previously have been initialized (see rwlock_init(SYNCH)).

Parameters


lock
pointer to the lock to be released

Return values

rw_unlock returns zero for success and an error number for failure.

Errors

If any the following conditions is detected, rw_unlock fails and returns the corresponding value:

EINVAL
invalid argument specified

ENOLCK
lock not locked

References

Intro(SYNCH), rwlock(SYNCH), rwlock_destroy(SYNCH), rwlock_init(SYNCH), rw_rdlock(SYNCH), rw_tryrdlock(SYNCH), rw_trywrlock(SYNCH), rw_wrlock(SYNCH)
© 2005 The SCO Group, Inc. All rights reserved.
SCO OpenServer Release 6.0.0 - 01 June 2005