diff --git a/src/kits/debugger/util/Worker.cpp b/src/kits/debugger/util/Worker.cpp index 3d4628996e..03f1ccc6d9 100644 --- a/src/kits/debugger/util/Worker.cpp +++ b/src/kits/debugger/util/Worker.cpp @@ -415,6 +415,13 @@ Worker::WaitForJob(Job* waitingJob, const JobKey& key) if (job == NULL) return JOB_DEPENDENCY_NOT_FOUND; + if (waitingJob->Dependency() == job) + return waitingJob->WaitStatus(); + if (job == waitingJob) + debugger("Jobs can't depend on themselves"); + if (waitingJob->Dependency() != NULL) + debugger("Job already has a dependency"); + waitingJob->SetWaitStatus(JOB_DEPENDENCY_ACTIVE); waitingJob->SetDependency(job); job->DependentJobs().Add(waitingJob);