}
}
```
The ReadyQueue object is defined in torch/csrc/autograd/engine.h and it is a simple wrapper over std::priority_queue that allows a thread to wait for a task if it’s empty. One interesting property of the ReadyQueue is that it increases the GraphTask::outstanding_tasks_ value used to determine if the execution has completed or not.
```c++
auto ReadyQueue::push(NodeTask item, bool incrementOutstandingTasks) -> void {
  {
    std::lock_guard lock(mutex_);
    if (incrementOutstandingTasks) {
      std::shared_ptr graph_task = item.base_.lock();
      ++graph_task->outstanding_tasks_;
    }