Skip to content

Commit 144c4e2

Browse files
committed
Only notify when necessary
1 parent 4db536d commit 144c4e2

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

soot-infoflow/src/soot/jimple/infoflow/util/ReusableExecutor.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,11 @@ public void execute(Runnable command) {
3636
@Override
3737
public void run() {
3838
command.run();
39-
counter.getAndDecrement();
40-
synchronized (obj) {
41-
obj.notify();
39+
int c = counter.getAndDecrement();
40+
if (c == 0) {
41+
synchronized (obj) {
42+
obj.notify();
43+
}
4244
}
4345
}
4446

0 commit comments

Comments
 (0)