Repository: incubator-mynewt-newt
Updated Branches:
  refs/heads/develop e5dfa220f -> cfcc24c81


newt - Prevent hang on simultaneous compile error.

The stop channel only had capacity for one entry.  If two go routines
fail at the same time, they both try to enqueue to the stop channel,
causing the second thread to block.

The fix is to give the stop channel more capacity.  Change it from 1 to
num-threads.


Project: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/commit/cfcc24c8
Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/tree/cfcc24c8
Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/diff/cfcc24c8

Branch: refs/heads/develop
Commit: cfcc24c81692652355d990d1963a59e8b4058f89
Parents: e5dfa22
Author: Christopher Collins <[email protected]>
Authored: Tue Jan 10 18:36:59 2017 -0800
Committer: Christopher Collins <[email protected]>
Committed: Tue Jan 10 18:36:59 2017 -0800

----------------------------------------------------------------------
 newt/builder/build.go | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/cfcc24c8/newt/builder/build.go
----------------------------------------------------------------------
diff --git a/newt/builder/build.go b/newt/builder/build.go
index a2a758f..4de98eb 100644
--- a/newt/builder/build.go
+++ b/newt/builder/build.go
@@ -520,7 +520,7 @@ func (b *Builder) Build() error {
        jobs := make(chan toolchain.CompilerJob, len(entries))
        defer close(jobs)
 
-       stop := make(chan struct{}, 1)
+       stop := make(chan struct{}, len(entries))
        defer close(stop)
 
        errors := make(chan error, newtutil.NewtNumJobs)

Reply via email to