Stuart, you have my blessing to commit what you have, even though both your
reviewers are still nitpicking that wait loop.

The thing that bothers me in

         while (<condition does not hold> and <timeout not exceeded>) {
             long timeout = ... ; // recompute timeout values

is that you can't check for <timeout not exceeded> until you've done
the "recompute
timeout values", so a straightforward improvement (?) should be:

         while (<condition does not hold>) {
             long timeout = ... ; // (re)compute timeout values
             int nanos = ... ;

             if (<timeout exceeded>) ... // handle timeout

             obj.wait(timeout, nanos);


(but real code would be messier, because you're not working in nanos)

Reply via email to