From 11e3b0d0006609e3835f4aa04f7cd7f6039239e8 Mon Sep 17 00:00:00 2001 From: Colin Cross Date: Wed, 4 Feb 2015 10:41:00 -0800 Subject: [PATCH] Fix deadlock when there are no modules Change-Id: Ibfc1190f2b5ac3c3445d40f1b5dd0cd782e63dfd --- context.go | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/context.go b/context.go index 9fea1db..da4643a 100644 --- a/context.go +++ b/context.go @@ -977,8 +977,7 @@ func (c *Context) parallelVisitAllBottomUp(visit func(group *moduleGroup)) { } } -loop: - for { + for count > 0 { select { case doneGroup := <-doneCh: for _, parent := range doneGroup.reverseDeps { @@ -988,9 +987,6 @@ loop: } } count-- - if count == 0 { - break loop - } } } }