diff options
author | Ian Lance Taylor <ian@gcc.gnu.org> | 2016-02-18 05:56:46 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@gcc.gnu.org> | 2016-02-18 05:56:46 +0000 |
commit | 43414a5dd3a9b9b02bc675e1c33140021c3848aa (patch) | |
tree | 66790d16b1ce811193f21d132f271823d10b20f9 /libgo/go/sync | |
parent | fa837fb670c502e7fbcb3f48aa1932b55704521c (diff) | |
download | gcc-43414a5dd3a9b9b02bc675e1c33140021c3848aa.zip gcc-43414a5dd3a9b9b02bc675e1c33140021c3848aa.tar.gz gcc-43414a5dd3a9b9b02bc675e1c33140021c3848aa.tar.bz2 |
libgo: Update to final Go 1.6 release.
Reviewed-on: https://go-review.googlesource.com/19592
From-SVN: r233515
Diffstat (limited to 'libgo/go/sync')
-rw-r--r-- | libgo/go/sync/waitgroup_test.go | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/libgo/go/sync/waitgroup_test.go b/libgo/go/sync/waitgroup_test.go index a581660..8ec34fd 100644 --- a/libgo/go/sync/waitgroup_test.go +++ b/libgo/go/sync/waitgroup_test.go @@ -128,13 +128,16 @@ func TestWaitGroupMisuse3(t *testing.T) { } }() defer runtime.GOMAXPROCS(runtime.GOMAXPROCS(4)) - done := make(chan interface{}, 1) + done := make(chan interface{}, 2) // The detection is opportunistically, so we want it to panic // at least in one run out of a million. for i := 0; i < 1e6; i++ { var wg WaitGroup wg.Add(1) go func() { + defer func() { + done <- recover() + }() wg.Done() }() go func() { @@ -150,8 +153,10 @@ func TestWaitGroupMisuse3(t *testing.T) { wg.Wait() }() wg.Wait() - if err := <-done; err != nil { - panic(err) + for j := 0; j < 2; j++ { + if err := <-done; err != nil { + panic(err) + } } } t.Fatal("Should panic") |