public void process ( ) throws InterruptedException { boolean alreadyInSync = Thread . currentThread ( ) instanceof WebcamProcessor . ProcessorThread ; if ( alreadyInSync ) { handle ( ) ; } else { if ( doSync ) { if ( processor == null ) { throw new RuntimeException ( "Driver should be synchronized, but processor is null" ) ; } processor . process ( this ) ; } else { handle ( ) ; } } }
Process task by processor thread .