From patchwork Wed Jan 26 23:53:22 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: libgo patch committed: Fix race condition in netchan test Date: Wed, 26 Jan 2011 13:53:22 -0000 From: Ian Taylor X-Patchwork-Id: 80567 Message-Id: To: gcc-patches@gcc.gnu.org, gofrontend-dev@googlegroups.com This patch, copied from the master Go library, avoids a race condition in the netchan test. The consequence of the race condition would normally be a deadlock. Bootstrapped and ran Go testsuite on x86_64-unknown-linux-gnu. Committed to mainline. Ian Index: libgo/go/netchan/netchan_test.go =================================================================== --- libgo/go/netchan/netchan_test.go (revision 169248) +++ libgo/go/netchan/netchan_test.go (working copy) @@ -395,7 +395,7 @@ func TestCrossConnect(t *testing.T) { t.Fatal("new importer:", err) } - go crossExport(e1, e2, t) + crossExport(e1, e2, t) crossImport(i1, i2, t) } @@ -413,7 +413,7 @@ func crossExport(e1, e2 *Exporter, t *te t.Fatal("exportReceive:", err) } - crossLoop("export", s, r, t) + go crossLoop("export", s, r, t) } // Import side of cross-traffic.