private void runSubmissions ( boolean block ) throws InterruptedException { if ( block ) { Runnable r = m_submissionQueue . take ( ) ; do { r . run ( ) ; } while ( ( r = m_submissionQueue . poll ( ) ) != null ) ; } else { Runnable r = null ; while ( ( r = m_submissionQueue . poll ( ) ) != null ) { r . run ( ) ; } } }
if there is no other work to do