about summary refs log tree commit diff
path: root/mthread.c
diff options
context:
space:
mode:
Diffstat (limited to 'mthread.c')
-rw-r--r--mthread.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/mthread.c b/mthread.c
index 064cbdc..b54b714 100644
--- a/mthread.c
+++ b/mthread.c
@@ -187,6 +187,10 @@ out:
 	if (parent && parent != c) {
 		struct container *r;
 
+		// check we don't introduce a new loop
+		if (reachable(parent, c) || reachable(c, parent))
+			goto out2;
+
 		if (c->parent == parent) { // already correct
 			goto out2;
 		} else if (c->parent) {