Jan Burse schrieb:
> Hi,
>
> markspace schrieb:
>> I don't see how "done" can be reliably reset. There's going to be a
>> race condition somewhere. Might as well use ReetrantLock, it solves
>> this problem.
>
> Do you refer to:
>
> Condition.awaitUninterruptibly() ?
> http://docs.oracle.com/javase/1.5.0/...ruptibly%28%29
>
>
> Didn't look yet at the source. What is the design?
>
> Bye
I guess if we were to allow to introduce a data structure
Condition or so, we could also do the same. Provide an
uninterruptableWait on this Condition. So we would again
divert from the original:
public static void uninterruptableWait(Object c);
And either have:
public static void uninterruptableWait(Condition c);
Or:
public class Condition;
public void uninterruptableWait();
Simplest datastructure would be:
public class Condition {
public Object lock = new Object();
public boolean done;
}
Bye