Logo Search packages:      
Sourcecode: pwlib version File versions  Download package

BOOL PSafeObject::LockReadWrite (  ) 

Lock the object for Read/Write access. This will lock the object in read/write mode. Multiple threads may lock the object read only, but only one thread can lock for read/write. Also no read only threads can be present for the read/write lock to occur and no read/write lock can be present for any read only locks to occur.

If the function returns FALSE, then the object has been flagged for deletion and the calling thread should immediately cease use of the object, possibly executing the SafeDereference() function to remove any references it may have acquired.

It is expected that the caller had already called the SafeReference() function (directly or implicitly) before calling this function. It is recommended that the PSafePtr<> class is used to automatically manage the reference counting and locking of objects.

Definition at line 163 of file safecoll.cxx.

References PReadWriteMutex::StartWrite().


  if (safelyBeingRemoved) {
    return FALSE;

  return TRUE;

Generated by  Doxygen 1.6.0   Back to index