This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

InterruptedException

 
pramod karnani
Ranch Hand
Posts: 88
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

when InterruptedException is being catch in lock method since wait throws InterruptedException then can I wrap InterruptedException within a subclass of RuntimeException ?

let say subclass is UserInterruptedException that extends RuntimeException


Regards,
Pramod
 
Roel De Nijs
Sheriff
Posts: 9168
76
AngularJS Chrome Eclipse IDE Hibernate Java jQuery MySQL Database Spring Tomcat Server
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi pramod,

I posted a question about how to handle the InterruptedException (more than a month ago) and got no replies at all. The thread can be found here and has a link to a website with an article about "how to handle InterruptedException?", so it's maybe valuable to you

Kind regards,
Roel
 
Alecsandru Cocarla
Ranch Hand
Posts: 158
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I did not read that article before submitting my assignment, so I just swallowed the exception and continued to wait. However, I don't think I'd have changed my approach. But I had a TimeoutException, which means anyway, after 5 seconds, the thread exits. So swallowing is just a delay, there's no possibility that my thread remains stuck, waiting forever.

This is my "InterruptedException code":

 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic