Skip to content

Commit

Permalink
Simplify AsynchExecThread to avoid duplicate barrier state upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
HeikoKlare committed Dec 19, 2023
1 parent 4b9ad9c commit 9f8ae54
Showing 1 changed file with 5 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,17 +49,13 @@ public void run() {

//must have positive work
current.beginTask(jobName, 1);
try {
if (current.isCanceled()) {
barrier.upgradeTo(TestBarrier2.STATUS_DONE);
job.done(Status.CANCEL_STATUS);
}
current.worked(1);
} finally {
barrier.upgradeTo(TestBarrier2.STATUS_DONE);
current.done();
if (current.isCanceled()) {
job.done(Status.CANCEL_STATUS);
} else {
job.done(Status.OK_STATUS);
}
barrier.upgradeTo(TestBarrier2.STATUS_DONE);
current.done();
}

}

0 comments on commit 9f8ae54

Please sign in to comment.