Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Interrupted Exception in Thread  RSS feed

 
Justin Fox
Ranch Hand
Posts: 802
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


ok, in the above code, how would the thread be interrupted?

as in an example.

Thanks,


Justin
 
Edwin Dalorzo
Ranch Hand
Posts: 961
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, at first sight, your main method seems to be executed in the "main" thread.

You're not interrupting the main thread anywhere else in your code, therefore, I must say, in the context of the code that you posted, that your main method will never be interrupted.

But you could interrupt you "main" thread from another thread, like this, for instance



I hope this helps!
 
Chetan Raju
Ranch Hand
Posts: 109
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I guess even using ^C on the console (if program is a standalone) would cause an Interrupted exception.
 
Peter Chase
Ranch Hand
Posts: 1970
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Chetan Raju:
I guess even using ^C on the console (if program is a standalone) would cause an Interrupted exception.


No, I don't think so. If it does, I want to know about it!
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!