java-tutorials/core-java-modules/core-java-lang-6
Ulisses Lima 03c615201f Update InterruptThread.java
Based on a comment:

Section 6 should be headlined with “Using System.exit()” since that’s what stops code execution, not the boolean variable (this is just a means to decide that execution should be stopped, like the negative array element in section 4.

Also it’s unclear why we’d need the “if (isInterrupted())” statement in the while loop of the 8th section: how should isInterrupted() be true one line after we’ve checked in the while loop header that it’s false? Admittedly there’s a little chance that the interrupt status changed between these 2 lines, but this if statement would make much more sense somewhere in the business logic code where more time has passed since the evaluation of “while (!isInterrupted())”… and if that business code doesn’t have that complexity/length, one should omit this if statement altogether, since it creates more confusion than it helps for timely reaction on an interruption.
2023-11-06 16:26:35 -03:00
..
src Update InterruptThread.java 2023-11-06 16:26:35 -03:00
README.md Update README.md 2023-10-20 22:06:57 +08:00
pom.xml BAEL-6871: Remove junit-jupiter-api dependency. 2023-09-05 19:44:37 +02:00