Skip to content

Commit

Permalink
Added comment
Browse files Browse the repository at this point in the history
  • Loading branch information
mnadeem committed Apr 20, 2021
1 parent 5f21d29 commit 2f5ea68
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,9 @@ private void heavyOperation(final Integer id) {
BigInteger factValue = BigInteger.ONE;
long t1 = System.nanoTime();
for (int i = 2; i <= 8000; i++) {
// Future.cancel(...) delivers an interrupt signal to the thread asking it to stop.
// You must ensure that your tasks respect the interrupt signals
// e.g. checks for Thread.currentThread().isInterrupted() at regular intervals.
if (Thread.currentThread().isInterrupted()) {
logger.warn("Task #{} Interrupted, returning.....", id);
break ;
Expand Down

0 comments on commit 2f5ea68

Please sign in to comment.