private DispatcherTask dequeueNextTask(String queueName){
synchronized (syncRoot) {
    Queue<DispatcherTask> queue=taskQueuesMap.get(queueName);
    if (queue == null) {
      return null;
    }
    DispatcherTask dispatcherTask=queue.poll();
    if (queue.isEmpty()) {
      taskQueuesMap.remove(queueName);
    }
    return dispatcherTask;
  }
}

private DispatcherTask dequeueNextTask ( String queueName ) { synchronized ( syncRoot ) { Queue < DispatcherTask > queue = taskQueuesMap . get ( queueName ) ; if ( queue == null ) { return null ; } DispatcherTask dispatcherTask = queue . poll ( ) ; if ( queue . isEmpty ( ) ) { taskQueuesMap . remove ( queueName ) ; } return dispatcherTask ; } }
polls task from the queue
