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

int phRWLock::tryWriteLock  ) 
 

This method tries to acquire the write lock (non-blocking). The method returns phRWLock_OWNED if the lock is still owned by another writer or any reader and phSUCCESS if it got the lock. It is sometimes the case where one wants to try to get a writer lock but waiting isn't needed. Execution can continue until the writer lock is available at a later point when writing to the protected area will take place.

Returns:
A value corresponding to the success of acquiring the write lock.
Return values:
phRWLock_OWNED The lock is already owned by another thread and was not acquired for writing.
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 writer 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 1149 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