Example1 - fix
public synchronized void update() {
int temp = Data ;
//process temp
// no thread may start another
// update until this one completes
Data = temp ;
}
Previous slide
Next slide
Back to first slide
View graphic version