summaryrefslogtreecommitdiff
path: root/libgo/go/runtime/testdata/testprog/preempt.go
diff options
context:
space:
mode:
Diffstat (limited to 'libgo/go/runtime/testdata/testprog/preempt.go')
-rw-r--r--libgo/go/runtime/testdata/testprog/preempt.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/libgo/go/runtime/testdata/testprog/preempt.go b/libgo/go/runtime/testdata/testprog/preempt.go
index 1c74d0e4352..fb6755a3725 100644
--- a/libgo/go/runtime/testdata/testprog/preempt.go
+++ b/libgo/go/runtime/testdata/testprog/preempt.go
@@ -20,6 +20,10 @@ func AsyncPreempt() {
runtime.GOMAXPROCS(1)
// Disable GC so we have complete control of what we're testing.
debug.SetGCPercent(-1)
+ // Out of an abundance of caution, also make sure that there are
+ // no GCs actively in progress. The sweep phase of a GC cycle
+ // for instance tries to preempt Ps at the very beginning.
+ runtime.GC()
// Start a goroutine with no sync safe-points.
var ready, ready2 uint32