aboutsummaryrefslogtreecommitdiff
path: root/libgo/go/sync
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@gcc.gnu.org>2016-02-18 05:56:46 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>2016-02-18 05:56:46 +0000
commit43414a5dd3a9b9b02bc675e1c33140021c3848aa (patch)
tree66790d16b1ce811193f21d132f271823d10b20f9 /libgo/go/sync
parentfa837fb670c502e7fbcb3f48aa1932b55704521c (diff)
downloadgcc-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.go11
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")