Re: RFR(xs): 6344935: Clarify Object.wait javadoc with respect to spurious wakeups

2017-08-11 Thread Martin Buchholz
OK, I'll try my hand as well at making forward progress: diff --git a/src/java.base/share/classes/java/lang/Object.java b/src/java.base/share/classes/java/lang/Object.java --- a/src/java.base/share/classes/java/lang/Object.java +++ b/src/java.base/share/classes/java/lang/Object.java @@ -334,7 +334

Re: RFR(xs): 6344935: Clarify Object.wait javadoc with respect to spurious wakeups

2017-08-11 Thread David Holmes
On 12/08/2017 10:58 AM, Hans Boehm wrote: Any chance the example code in the documentation that is quoted below could also be adjusted to e.g. synchronized (obj) { while () { ; obj.wait(); } ... // Perform action appropriate to con

Re: RFR(xs): 6344935: Clarify Object.wait javadoc with respect to spurious wakeups

2017-08-11 Thread Martin Buchholz
Thanks for working on Object.wait. Doc writing is never easy, especially in Object.java. In the original proposed patch, the word "also" ends up weird, because spurious wakeup *was* in the list above; we need to do something about that. On Fri, Aug 11, 2017 at 11:25 AM, Stuart Marks wrote: > T

Re: RFR(xs): 6344935: Clarify Object.wait javadoc with respect to spurious wakeups

2017-08-11 Thread Hans Boehm
Any chance the example code in the documentation that is quoted below could also be adjusted to e.g. synchronized (obj) { while () { ; obj.wait(); } ... // Perform action appropriate to condition } and similarly for the nanos case? I

Re: RFR(xs): 6344935: Clarify Object.wait javadoc with respect to spurious wakeups

2017-08-11 Thread David Holmes
On 12/08/2017 5:14 AM, Stuart Marks wrote: In general, I'm in favor of ensuring that wording in various bits of the specification is well aligned. I don't see specifically what would need to be improved in this case, though. If you start trying to align things too much you end up rewriting a h

Re: RFR(xs): 6344935: Clarify Object.wait javadoc with respect to spurious wakeups

2017-08-11 Thread Stuart Marks
In general, I'm in favor of ensuring that wording in various bits of the specification is well aligned. I don't see specifically what would need to be improved in this case, though. Can we align the wording with existing wording in either LockSupport or Condition? The various LockSupport.par

Re: RFR(xs): 6344935: Clarify Object.wait javadoc with respect to spurious wakeups

2017-08-11 Thread Martin Buchholz
There's also an existing paragraph in Condition that goes "When waiting upon a Condition, a spurious ... " On Fri, Aug 11, 2017 at 11:50 AM, Martin Buchholz wrote: > Can we align the wording with existing wording in either LockSupport or > Condition? > > On Fri, Aug 11, 2017 at 11:25 AM, Stuart

Re: RFR(xs): 6344935: Clarify Object.wait javadoc with respect to spurious wakeups

2017-08-11 Thread Martin Buchholz
Can we align the wording with existing wording in either LockSupport or Condition? On Fri, Aug 11, 2017 at 11:25 AM, Stuart Marks wrote: > This is an old spec bug. The Object.wait spec lists several different > reasons a thread could be awakened, but it omits spurious wakeup -- even > though spu

Re: RFR(xs): 6344935: Clarify Object.wait javadoc with respect to spurious wakeups

2017-08-11 Thread mandy chung
On 8/11/17 11:25 AM, Stuart Marks wrote: diff -r 27b08ab97a60 -r ebd66cd27b29 src/java.base/share/classes/java/lang/Object.java --- a/src/java.base/share/classes/java/lang/Object.javaThu Aug 03 09:04:47 2017 -0700 +++ b/src/java.base/share/classes/java/lang/Object.javaFri Aug 11 11:24

Re: RFR(xs): 6344935: Clarify Object.wait javadoc with respect to spurious wakeups

2017-08-11 Thread Lance Andersen
Looks fine Stuart > On Aug 11, 2017, at 2:25 PM, Stuart Marks wrote: > > This is an old spec bug. The Object.wait spec lists several different reasons > a thread could be awakened, but it omits spurious wakeup -- even though > spurious wakeup is described later on. The fix is simply to add sp