Exemple #1
0
  private synchronized void nextTask() {
    if (executing) {
      return;
    }

    BaseDBTask task;
    if ((task = taskQueue.poll()) != null) {
      executing = true;
      task.execute();
    }
  }
Exemple #2
0
 public synchronized void execute(BaseDBTask task) {
   task.setExecutorCallback(this);
   taskQueue.add(task);
   nextTask();
 }