Thread: Thread killing
View Single Post
  #13 (permalink)  
Old 09-25-2008, 10:14 PM
masijade masijade is offline
Senior Member
 
Join Date: Jun 2008
Posts: 549
masijade is on a distinguished road
Quote:
Originally Posted by Norm View Post
If the thread isn't calling a method that is interruptable when the interrupt is sent, then catch block will never be called.The thread will have to test to see if it has been interrupted and then handle that in normal code, not in a catch block.
One more point, the test must be in normal code, but the cleanup can still be in a catch block. Simply throw an InterruptedException when interrupted() returns true.
Reply With Quote