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. |