Program: 161720
Project: 161720
Buggy source:
/** 
 * Progresses tasks for the current time.  This will block as it runs as many scheduled or waiting tasks as possible.  It is CRITICAL that  only one thread at a time calls the .tick() function.  While this class  is in general thread safe, if multiple threads call .tick() at the same  time, it is possible a given task may run more than once.  In order to  maintain high performance, threadly does not guard against this condition. Depending on how this class was constructed, this may or may not block  if there are no tasks to run yet. If any tasks throw a RuntimeException, they will be bubbled up to this  tick call.  Any tasks past that task will not run till the next call to  tick.  So it is important that the implementor handle those exceptions.   This call is NOT thread safe, calling tick in parallel could cause the  same task to be run multiple times in parallel.
 * @return qty of tasks run during this tick call
 * @throws InterruptedException thrown if thread is interrupted waiting for task to run(this can only throw if constructed with a true to allow blocking)
 */
public int tick() throws InterruptedException {
  int tasks=0;
  while (true) {
    TaskContainer nextTask;
    while ((nextTask=getNextReadyTask()) != null && !cancelTick) {
      tasks++;
      nextTask.runTask();
    }
    if (tickBlocksTillAvailable && tasks == 0) {
synchronized (taskQueue.getModificationLock()) {
        if (cancelTick) {
          break;
        }
        nextTask=taskQueue.peekFirst();
        if (nextTask == null) {
          taskQueue.getModificationLock().wait();
        }
 else {
          long nextTaskDelay=nextTask.getDelay(TimeUnit.MILLISECONDS);
          if (nextTaskDelay > 0) {
            taskQueue.getModificationLock().wait(nextTaskDelay);
          }
        }
      }
    }
 else {
      break;
    }
  }
  if (cancelTick) {
    cancelTick=false;
  }
  return tasks;
}

Fixed version (ground truth):
/** 
 * Progresses tasks for the current time.  This will block as it runs as many scheduled or waiting tasks as possible.  It is CRITICAL that  only one thread at a time calls the .tick() function.  While this class  is in general thread safe, if multiple threads call .tick() at the same  time, it is possible a given task may run more than once.  In order to  maintain high performance, threadly does not guard against this condition. Depending on how this class was constructed, this may or may not block  if there are no tasks to run yet. If any tasks throw a RuntimeException, they will be bubbled up to this  tick call.  Any tasks past that task will not run till the next call to  tick.  So it is important that the implementor handle those exceptions.   This call is NOT thread safe, calling tick in parallel could cause the  same task to be run multiple times in parallel.
 * @return quantity of tasks run during this tick invocation
 * @throws InterruptedException thrown if thread is interrupted waiting for task to run(this can only throw if constructed with a true to allow blocking)
 */
public int tick() throws InterruptedException {
  int tasks=0;
  while (true) {
    TaskContainer nextTask;
    while ((nextTask=getNextReadyTask()) != null && !cancelTick) {
      tasks++;
      nextTask.runTask();
    }
    if (tickBlocksTillAvailable && tasks == 0) {
synchronized (taskQueue.getModificationLock()) {
        if (cancelTick) {
          break;
        }
        nextTask=taskQueue.peekFirst();
        if (nextTask == null) {
          taskQueue.getModificationLock().wait();
        }
 else {
          long nextTaskDelay=nextTask.getDelay(TimeUnit.MILLISECONDS);
          if (nextTaskDelay > 0) {
            taskQueue.getModificationLock().wait(nextTaskDelay);
          }
        }
      }
    }
 else {
      break;
    }
  }
  if (cancelTick) {
    cancelTick=false;
  }
  return tasks;
}