summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2021-08-28 18:50:52 +0200
committerBent Bisballe Nyeng <deva@aasimon.org>2021-08-28 18:50:52 +0200
commitb23009162688e361cf8e3ab3cba74234adbab5fd (patch)
tree8234fd76373353c9d4d509eb6db377dbe2b87979
parentb1ba703f2ddb6707f5931faa88b4ad8a6c07a7e8 (diff)
Dead-lock detection if a task runs but doesn't become 'undirty' as a result.
-rw-r--r--build.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/build.cc b/build.cc
index e057a02..445979e 100644
--- a/build.cc
+++ b/build.cc
@@ -54,6 +54,12 @@ int build(const Settings& settings,
auto task = getNextTask(all_tasks, dirtyTasks);
if(task == nullptr)
{
+ if(processes.empty() && !dirtyTasks.empty())
+ {
+ // No running processes, yet no process to run. This is a dead-lock...
+ std::cout << "Dead-lock detected.\n";
+ return 1;
+ }
break;
}