If the lock is not available then the current thread becomes disabled for thread scheduling purposes and lies dormant until the lock has been acquired. If the lock is acquired, it is held until unlock
is invoked, or until leaseTime milliseconds have passed since the lock was granted - whichever comes first.
@param leaseTime the maximum time to hold the lock after granting it, before automatically releasing it if it hasn't already been released by invoking unlock
. If leaseTime is -1, hold the lock until explicitly unlocked.
@param unit the time unit of the {@code leaseTime} argument
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|