public class LatchLock extends Object
| Modifier and Type | Field and Description |
|---|---|
protected AtomicInteger |
latchSize
当前并发大小
|
protected int |
limit
流量限制大小
|
| Constructor and Description |
|---|
LatchLock() |
| Modifier and Type | Method and Description |
|---|---|
int |
getLatchSize()
当前已获取锁个数
|
LatchLock |
limit(int limit)
设置限制
|
int |
release()
释放一个锁
|
boolean |
tryLock()
获取锁
|
protected int limit
protected final AtomicInteger latchSize
public LatchLock limit(int limit)
limit - >0public boolean tryLock()
public int release()
public int getLatchSize()
Copyright © 2022. All rights reserved.