wood burning stoves 2.0*
The moose likes Threads and Synchronization and the fly likes Question on Thread interrupt method. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Threads and Synchronization
Bookmark "Question on Thread interrupt method." Watch "Question on Thread interrupt method." New topic
Author

Question on Thread interrupt method.

Siva Masilamani
Ranch Hand

Joined: Sep 19, 2008
Posts: 385
Hi

I am preparing for SCJP exam and came across this question in Devaka exam.Could somebody please explain why the user thread is not interrupted even though main thread set the interrupt when the user thread is sleeping?

I see the output as Ex-B followed by exception.Why not Ex-A is not printed?Why the interrupt method not woking here?



SCJP 6,SCWCD 5,SCBCD 5

Failure is not an option.
Siva Masilamani
Ranch Hand

Joined: Sep 19, 2008
Posts: 385
Hi

I got the answer myself.We are setting the interrupt only on 'a' not on 't'.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Question on Thread interrupt method.
 
Similar Threads
Thread interrupt confusion
Thread Problem
Question from examlab on threads
Issue regarding Executing Thread
Q 28 of examlab practice test 3