On Nov 23, 12:19 pm, Lew <l...@lewscanon.comwrote:
chris wrote:
try{ Thread.sleep(3000);}
catch (InterruptedException ie) { ??? Not a bloody thing I can do
about it ???}
Wrong. There are many bloody things you can do about that in Java. You just
don't know them yet.
In the example given, which I admit was rather simplistic, there
really isn't anything you can do about it.
You are right in that there are several things I MUST do if a
MEANINGFUL thread is interrupted (save state, try and recover, exit
gracefully and try again), but not in the STATIC sleep() method other
than a) ignore b) try again (If I really must sleep).
Short of virtual machine errors, I can't think of anything that would
cause Thread.sleep() to throw an exception.
Perhaps that would have been better served by throwing an error rather
than an exception.