public boolean lock(boolean shared, boolean block)(Code)
Lock the shared advisory lock. This method will
create a shared "read" lock when the shared
argument is true and an exclusive "write" lock
when the shared argument is false. If the block
argument is false then this call will not block
if the lock can't be obtained.