[concurrency-interest] Having TimeoutException be a subclass of InterruptedException

Luke Blanshard blanshlu@netscape.net
Thu, 05 Dec 2002 16:11:13 -0500


I have a question about having TimeoutException inherit from InterruptedException.  In the current JVM, an InterruptedException always means that the current thread has been interrupted.  I often keep track of this fact by setting a flag in the catch block for InterruptedException, and re-interrupting the thread when I've finished cleaning up after the interruption, so that outer or later code will also know that it is supposed to complete early.

With this new subclass, you appear to have destroyed a useful invariant of the JVM.

Any reason not to just have it be its own class?

Luke

__________________________________________________________________
The NEW Netscape 7.0 browser is now available. Upgrade now! http://channels.netscape.com/ns/browsers/download.jsp 

Get your own FREE, personal Netscape Mail account today at http://webmail.netscape.com/