A DESCRIPTION OF THE REQUEST :
Allow Object.wait(long) to return a long value. Doing so will permit the developer to determine whether or not the return from the wait was from a notify() call by some other thread or by the wait's timeout. Wait(long) will return a long value greater than 0 when a notify() has occured. It will return a 0 when the wait has timed out.
JUSTIFICATION :
See Description
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
long l;
while (true) {
//...
l = wait(60000);
if (l > 0) {
// wait timed out
break;
}
// notify occured
}
// exit gracefully
ACTUAL -
long then;
long now;
while (true) {
//...
then = (new java.util.Date()).getTime();
wait(decay);
now = (new java.util.Date()).getTime();
if (now - then - decay >= 0) {
break; // exit gracefully
}
// notify occured
}
// exit gracefully
---------- BEGIN SOURCE ----------
see above
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
see above
###@###.### 10/11/04 04:57 GMT