File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

What causes a thread to be interrupted?

 
Kjeld Sigtermans
Ranch Hand
Posts: 127
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

When running my code, at some point an InterruptedException is thrown during the execution of a Thread.sleep(...) instruction.
I have not explicitly interrupted the thread. I understand a thread is interrupted when its interrupt() method is called.
The big question is: what has caused my thread to be interrupted during its peaceful nap. Iow what can cause a thread to be interrupted? In this case, who has interrupted my thread?

Cheers,
Kjeld
 
Lester Burnham
Rancher
Posts: 1337
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The stack trace of the InterruptedException may give it a clue where it originated.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic