PPT Slide
public synchronized void startWrite()
{
writersWaiting++;
while(readers > 0 || writers > 0)
wait();
writersWaiting--;
writers++;
theWriter = Thread.currentThread();
}
public synchronized void endWrite()
{
writers--;
theWriter = null;
notifyAll();
}
Previous slide
Next slide
Back to first slide
View graphic version