Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Interrupt Handling

 
Java Kt
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i have read it on http://download.oracle.com/javase/tutorial/essential/concurrency/interrupt.html that
if a thread goes a long time without invoking a method that throws InterruptedException, then it must periodically invoke Thread.interrupted,
which returns true if an interrupt has been received.


If i am rightly understood the statement it means do we have to hadle interrup check in our code ,if thread goes a long time without invoking
a method that throws InterruptedException? Is it correct?

considering the below example if the interruption comes during sleep it will print the message
but if the interruption comes once the thread comes out of sleep it wont go inside catch block for InterruptedException
} correct?



 
money grubbing section goes here:
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!