Object.wait(long) spec:
, , -, . , , , , , . , , :
synchronized (obj) {
while (<condition does not hold>)
obj.wait(timeout);
...
}
(For more information on this, see section 3.2.3 in Doug Lea, “Parallel Programming in Java (Second Edition)” (Addison-Wesley, 2000) or paragraph 50 in Joshua Bloch, “Java Programming Language Guide” (Addison- Wesley, 2001).
source
share