public void run ( ) { // Note: To make sure the user gets a chance to see the // html text, we wait for a paint before returing. // Since these threads are stacked in a private thread queue, the next // thread is not executed until this one is finished. if ( ! EventQueue . isDispatchThread ( ) ) // && Runtime.getRuntime().availableProcessors() == 1) { if ( ! m_syncPage . isPaintCalled ( ) ) { // Wait for the previous call to finish synchronized ( m_syncPage ) { while ( ! m_syncPage . isPaintCalled ( ) ) { try { m_syncPage . wait ( ) ; } catch ( InterruptedException e ) { } } } } synchronized ( m_syncPage ) { m_syncPage . setPaintCalled ( false ) ; this . runPageLoader ( ) ; while ( ! m_syncPage . isPaintCalled ( ) ) { try { m_syncPage . wait ( ) ; } catch ( InterruptedException e ) { } } this . afterPageDisplay ( ) ; } } }
Make sure everything goes in the right order .