#include <p6lock.h>
Inherits P6R::p6ICom.
Public Member Functions | |
virtual P6INT32 | addref (void)=0 |
virtual P6R::P6ERR | initialize (void)=0 |
virtual P6R::P6ERR | queryInterface (const P6R::P6IID &iid, P6VOID **ppIface)=0 |
virtual P6R::P6ERR | readLock (void)=0 |
virtual P6INT32 | release (void)=0 |
virtual P6R::P6ERR | unlock (void)=0 |
virtual P6R::P6ERR | writeLock (void)=0 |
Reader/Writer locking.
Reader/Writer locks are used to protect data, not code. RWLocks are much more effecient if the majority of accesses are "safe" and do not modify any data. Read locks allow multiple threads to all enter the locked region at the same time. Read are considered "safe". When a write lock is held, only the that writer is given access. All other readers and writers must wait for the lock to be given up before they will be able to enter the locked region.