@ Override public void finish ( ) { if ( started . get ( ) && ! finished . getAndSet ( true ) ) { waitUntilFinished ( ) ; super . finish ( ) ; // recreate thread (don't start) for processor reuse createProcessorThread ( ) ; clearQueues ( ) ; started . set ( false ) ; } }
Signals that the processor to finish and waits until it finishes .