code: public boolean handleNextTask() {
  		Runnable task = this.getNextTask();
  
  		if (task != null) {
  			synchronized (this.tasksReachesZero) {
  				this.runningTasks++;
  			}
  			try {
  				task.run();
  			} catch (Throwable t) {
  				t.printStackTrace();
  			}
  
  			synchronized (this.tasksReachesZero) {
  				this.runningTasks--;
  				if (this.runningTasks == 0) {
  					this.tasksReachesZero.notifyAll();
  				}
  			}
  
  			synchronized (task) {
  				task.notifyAll();
  			}
  			return true;
  		}
  		return false;
  	}
docs: Process the next pending Task synchronously.
  @return true if a task has been processed, false otherwise (no task is ready to be processed)