tryLock is the same as lock except it returns a boolean indicating whether the lock was granted instead of generating an exception.
@param obj The object to acquire a lock on.
@param lockMode The lock mode to acquire. The lock modes are READ,UPGRADE, and WRITE.
@return True if the lock has been acquired, otherwise false.
| |