JDK-4031615 : Object.wait(long timeout) method should throw an exception when timeout expires
  • Type: Enhancement
  • Component: core-libs
  • Sub-Component: java.lang
  • Affected Version: 1.1
  • Priority: P3
  • Status: Closed
  • Resolution: Duplicate
  • OS: solaris_2.5
  • CPU: sparc
  • Submitted: 1997-02-11
  • Updated: 1997-05-14
  • Resolved: 1997-05-14
Related Reports
Duplicate :  
Description

Name: mc57594			Date: 02/11/97


ambiguous sematics:

wait can return for two reasons:
1. timeout expired
2. someother object called notify (or notifyAll) on this object.

Problem is that I don't know (from current semantics) why wait
returned. 
So, if I want to take different actions (which is the most likely
case) based on whether timeout expired or notify was called then 
I can't do that.

I have found no clean way to fix this problem.
company  -  Washington University  , email  -  ###@###.###
======================================================================

Comments
WORK AROUND Name: mc57594 Date: 02/11/97 wait(long timeout) should throw a new type of exception, say TimeoutException on timeout expiry. ======================================================================
11-06-2004