code: private List<Task> receiveTasks() {
  		synchronized (mutex) {
  			if (tasks.isEmpty()) {
  				return Collections.emptyList();
  			} else {
  				List<Task> currentTasks = tasks;
  				tasks = new ArrayList<Task>();
  				return currentTasks;
  			}
  		}
  	}
docs: Receives all added log entries.
  
  @return Log entries to write