Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Wiki Markup
The {{Thread.interrupt()}} method is frequently used to awaken a blocked thread before it can be stopped. It awakens threads that are blocked on {{wait()}} methods of class {{Object}}, and {{join}} and {{sleep}} methods of class {{Thread}}. In these cases, the thread's interrupt status is cleared and it receives an {{InterruptedException}}. If the thread is blocked on I/O operations upon an interruptible channel, the channel is closed, the thread's interrupt status is set and theit thread receives a {{ClosedByInterruptException}}. Similarly, a thread waiting on a selector also returns from the operation with its interrupted status set. \[[API 06|AA. Java References#API 06]\].   

Compliant Solution (1) (volatile flag)

...