InterruptedException « State « Java Thread Q&A

Home
Java Thread Q&A
1.concurrency
2.Development
3.Exception
4.Notify
5.Operation
6.Socket
7.State
8.synchronize
9.Thread Safe
10.ThreadPool
Java Thread Q&A » State » InterruptedException 

1. When does Java's Thread.sleep throw InterruptedException?    stackoverflow.com

When does Java's Thread.sleep throw InterruptedException? Is it safe to ignore it? I am not doing any multithreading. I just want to wait for a few seconds before ...

2. InterruptedException from Thread.sleep()    stackoverflow.com

In Java, Thread.sleep() throws InterruptedException. What is the proper thing to do with this exception?

  1. propagate the exception as a failure up the call chain
  2. eat the exception and proceed ...

3. What's a good sample program to demonstrate improper handling of InterruptedException thrown by Thread.sleep()?    stackoverflow.com

I've been reading around about InterruptedException, and it's immediately apparent that there's no silver bullet solution to handle it properly in all cases. What I haven't seen yet, is some sample code ...

5. Thread.sleep() and InterruptedException - what does it imply?    forums.oracle.com

Hi, the Thread.sleep() method can throw an InterruptedException, and I want to be sure I know what this exception implies and therefore how to handle it. My understanding is that this exception if thrown, could mean that the sleep() has terminated before the specified duration has completed. Is this correct? It matters because my calling method wants a minimum time to ...

java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.