public class SyncFinisher extends Object
| Modifier and Type | Class and Description |
|---|---|
class |
SyncFinisher.Worker
工作者,为一个线程
|
| Constructor and Description |
|---|
SyncFinisher() |
| Modifier and Type | Method and Description |
|---|---|
void |
addWorker(SyncFinisher.Worker worker)
增加工作线程
|
void |
await()
等待所有Worker工作结束,否则阻塞
|
void |
clearWorker()
清空工作线程对象
|
long |
count() |
void |
start()
开始工作
|
public void addWorker(SyncFinisher.Worker worker)
worker - 工作线程public void start()
public void await()
throws InterruptedException
InterruptedException - 用户中断public void clearWorker()
public long count()
Copyright © 2020. All rights reserved.