public interface Locker
| 限定符和类型 | 方法和说明 |
|---|---|
long |
tryLock(String lockKey)
Try get lock, default lock expire time is 4s
|
long |
tryLock(String lockKey,
long lockExpireTime)
Try get lock, and set lock expire time(millisecond)
|
void |
unLock(String lockKey,
long lockReleaseTime)
Release the lock, check the lock has expired(millisecond)
|
long tryLock(String lockKey)
lockKey - the key of locklong tryLock(String lockKey, long lockExpireTime)
lockKey - the key of locklockExpireTime - the expire time of lockvoid unLock(String lockKey, long lockReleaseTime)
lockKey - the key of locklockReleaseTime - the release time of lockCopyright © 2019. All rights reserved.