Example2 Fix
public synchronized int getData() {
while (writeable) {
try { wait();}
catch (InterruptedException e) {
System.err.println(“Exception “ + e);
}
}
writeable = true;
notify();
return Data;
}
Previous slide
Next slide
Back to first slide
View graphic version