Program: 76084
Project: 76084
Buggy source:
/** 
 * Suspend the calling thread until a deadlock is detected. On resuming, handle the various deadlocks appropriately. Break the deadlock if possible. If the deadlock is an artificial deadlock, then select the receiver with the smallest queue capacity on which any process is blocked on a write and increment the capacity of the contained queue. If the capacity is non-negative, then increment the capacity by 1. Otherwise set the capacity to 1. Unblock the process blocked on this receiver. Notify the thread corresponding to the blocked process. If the deadlock is a timed deadlock, process any pending topology change requests. If there are no pending requests, then advance the time to the earliest value when a time-blocked process can be awakened. If the deadlock detected is a real deadlock, then do nothing. If processing the queued topology change requests, then inform the registered topology listeners of each change in a series of calls after successful completion of each request. If any queued request fails, the request is undone, and no further requests are processed. Note that change requests processed successfully prior to the failed request are <i>not</i> undone. Create receivers for any new actors created, initialize the new actors, and create new threads for these actors. After all threads are created, resume the execution and start the threads for the newly created actors. This method returns only on occurrence of a real deadlock. <b>This method is synchronized on the director. This method is normally called by the directing thread. </b>
 * @exception IllegalActionException If any of the called methods throwit.
 */
public void fire() throws IllegalActionException {
  boolean timedmut;
  Workspace worksp=workspace();
synchronized (this) {
    _mutationBlockCount=0;
    _mutationsRequested=false;
    while (_readBlockCount != _getActiveActorsCount() && !_areActorsStopped()) {
      while (!_areActorsDeadlocked() && !_areActorsStopped()) {
        worksp.wait(this);
      }
      if (!_areActorsStopped()) {
        _notDone=_resolveDeadlock();
      }
    }
  }
  return;
}

Fixed version (ground truth):
/** 
 * Suspend the calling thread until a deadlock is detected. On resuming, handle the various deadlocks appropriately. Break the deadlock if possible. If the deadlock is an artificial deadlock, then select the receiver with the smallest queue capacity on which any process is blocked on a write and increment the capacity of the contained queue. If the capacity is non-negative, then increment the capacity by 1. Otherwise set the capacity to 1. Unblock the process blocked on this receiver. Notify the thread corresponding to the blocked process. If the deadlock is a timed deadlock, process any pending topology change requests. If there are no pending requests, then advance the time to the earliest value when a time-blocked process can be awakened. If the deadlock detected is a real deadlock, then do nothing. If processing the queued topology change requests, then inform the registered topology listeners of each change in a series of calls after successful completion of each request. If any queued request fails, the request is undone, and no further requests are processed. Note that change requests processed successfully prior to the failed request are <i>not</i> undone. Create receivers for any new actors created, initialize the new actors, and create new threads for these actors. After all threads are created, resume the execution and start the threads for the newly created actors. This method returns only on occurrence of a real deadlock. <b>This method is synchronized on the director. This method is normally called by the directing thread. </b>
 * @exception IllegalActionException If any of the called methods throwit.
 */
public void fire() throws IllegalActionException {
  boolean timedmut;
  Workspace worksp=workspace();
synchronized (this) {
    _mutationBlockCount=0;
    _mutationsRequested=false;
    while (_readBlockCount != _getActiveActorsCount()) {
      while (!_areActorsDeadlocked()) {
        worksp.wait(this);
      }
      _notDone=_resolveDeadlock();
    }
  }
  return;
}