public void accept ( Task task ) { if ( ( activeIndex + 1 ) % 2 == 0 ) { if ( ! task . isInQueue0 ( ) ) { taskList [ 0 ] . offer ( task ) ; task . storedInQueue0 ( ) ; } } else { if ( ! task . isInQueue1 ( ) ) { taskList [ 1 ] . offer ( task ) ; task . storedInQueue1 ( ) ; } } }
Queues specified task using tasks dead line time .