This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
}
} // end of State
public void testReaderWriterWaitReaderGo() {
class Worker implements Runnable {
private int state;
public void run() {
switch( state ) {
case 0:
synchronized ( this ) {
state = 1;
p.enterReadAccess();
RequestProcessor.getDefault().post( this );
try {
wait();
catch( InterruptedException e ) {
e.printStackTrace();
p.exitReadAccess();
break;
case 1:
state = 2;
RequestProcessor.getDefault().postRequest( this, 100 );
p.enterWriteAccess();
case 2:
state = 3;
notifyAll();
Worker w = new Worker();
w.run();
assertEquals( "Second reader has finished", 3, w.state );