rwlock.c File Reference

#include "thread.h"

Data Structures

struct  RwLock

Functions

void Ns_RWLockInit (Ns_RWLock *rwPtr)
void Ns_RWLockDestroy (Ns_RWLock *rwPtr)
void Ns_RWLockRdLock (Ns_RWLock *rwPtr)
void Ns_RWLockWrLock (Ns_RWLock *rwPtr)
void Ns_RWLockUnlock (Ns_RWLock *rwPtr)

Function Documentation

void Ns_RWLockDestroy ( Ns_RWLock *  rwPtr  ) 

----------------------------------------------------------------------

Ns_RWLockDestroy --

Destory a read/write lock if it was previously initialized.

Results: None.

Side effects: Read/write lock objects are destroy and the lock memory is returned to the heap.

----------------------------------------------------------------------

void Ns_RWLockInit ( Ns_RWLock *  rwPtr  ) 

----------------------------------------------------------------------

Ns_RWLockInit --

Initialize a read/write lock.

Results: None.

Side effects: Lock memory is allocated from the heap and initialized.

----------------------------------------------------------------------

void Ns_RWLockRdLock ( Ns_RWLock *  rwPtr  ) 

----------------------------------------------------------------------

Ns_RWLockRdLock --

Aquire a read lock.

Results: None.

Side effects: Thread may wait on a condition variable if the read/write lock currently has a write lock.

----------------------------------------------------------------------

Wait on the read condition while the lock is write-locked or some other thread is waiting for a write lock.

void Ns_RWLockUnlock ( Ns_RWLock *  rwPtr  ) 

----------------------------------------------------------------------

Ns_RWLockUnlock --

Unlock a read/write lock.

Results: None.

Side effects: Read or write condition may be signaled.

----------------------------------------------------------------------

void Ns_RWLockWrLock ( Ns_RWLock *  rwPtr  ) 

----------------------------------------------------------------------

Ns_RWLockWrLock --

Aquire a write lock.

Results: None.

Side effects: Thread may wait on the write condition if other threads either have the lock read or write locked.

----------------------------------------------------------------------


Generated on Tue Sep 4 19:58:57 2007 by  doxygen 1.5.1