add try-finally
This commit is contained in:
@@ -70,9 +70,13 @@ public class EventThread extends Thread {
|
||||
getExecutorService().execute(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
try {
|
||||
task.run();
|
||||
} finally {
|
||||
if (counter.decrementAndGet() == 0) {
|
||||
service.shutdown();
|
||||
thread = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user