public SiteTasker take() throws InterruptedException
    {
        SiteTasker task = m_tasks.poll();

        if (task == null) {
            m_starvationTracker.beginStarvation();
        } else {
            m_queueDepthTracker.pollUpdate(task.getQueueOfferTime());
            return task;
        }
        try {
            task = CoreUtils.queueSpinTake(m_tasks);
            // task is never null
            m_queueDepthTracker.pollUpdate(task.getQueueOfferTime());
            return task;
        } finally {
            m_starvationTracker.endStarvation();
        }
    }
public SiteTasker take ( ) throws InterruptedException { SiteTasker task = m_tasks . poll ( ) ; if ( task == null ) { m_starvationTracker . beginStarvation ( ) ; } else { m_queueDepthTracker . pollUpdate ( task . getQueueOfferTime ( ) ) ; return task ; } try { task = CoreUtils . queueSpinTake ( m_tasks ) ; m_queueDepthTracker . pollUpdate ( task . getQueueOfferTime ( ) ) ; return task ; } finally { m_starvationTracker . endStarvation ( ) ; } }
Block on the site tasker queue.