Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

int phRWLock::tryReadLock  ) 
 

Try to get a reader lock (non-blocking). This will attempt to get a reader lock but won't wait for the lock to be available. If there are already readers that have the reader lock then this thread will increment the reader count to let other threads know that the reader section is still available. The general cause for this method failing to acquire the lock is when someone already has the write lock and hasn't released it.

Returns:
A value corresponding to the success of acquiring the read lock.
Return values:
phRWLock_OWNED The lock is already owned by another thread and was not acquired for reading.
phRWLock_NOTLOCKED The try on the lock failed for some other non-fatal reason than the lock being owned by another thread.
phSUCCESS The reader-writer lock was successfully locked for reading mode.
phFAIL The reader-writer lock acquisition failed for some fatal reason than the lock being owned by another thread. See phMutex::trylock() for some ideas that might cause this.

Definition at line 709 of file phRWLock.cpp.





Copyright (C) 2002 - 2007 Philip D.S. Thoren ( pthoren@users.sourceforge.net )
University Of Massachusetts at Lowell
Robotics Lab
SourceForge.net Logo

Generated on Sat Jun 16 02:45:10 2007 for phission by  doxygen 1.4.4