aboutsummaryrefslogtreecommitdiff
path: root/libgo/go/runtime/select.go
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@gcc.gnu.org>2018-02-16 16:42:53 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>2018-02-16 16:42:53 +0000
commitc3ab26e8bb0c5bf1c20358d036f987a20734c9ad (patch)
treed5ba10b1e7a7066a1d806d7a74159a141f9f53b8 /libgo/go/runtime/select.go
parent3943b161342a68ec90a7b977cf6a8e451671e25d (diff)
downloadgcc-c3ab26e8bb0c5bf1c20358d036f987a20734c9ad.zip
gcc-c3ab26e8bb0c5bf1c20358d036f987a20734c9ad.tar.gz
gcc-c3ab26e8bb0c5bf1c20358d036f987a20734c9ad.tar.bz2
runtime: add some more preemption checks
In particular this lets BenchmarkPingPongHog in runtime/proc_test.go complete. Reviewed-on: https://go-review.googlesource.com/94735 From-SVN: r257743
Diffstat (limited to 'libgo/go/runtime/select.go')
-rw-r--r--libgo/go/runtime/select.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/libgo/go/runtime/select.go b/libgo/go/runtime/select.go
index 096af52..1c5124b 100644
--- a/libgo/go/runtime/select.go
+++ b/libgo/go/runtime/select.go
@@ -584,6 +584,13 @@ retc:
if cas.releasetime > 0 {
blockevent(cas.releasetime-t0, 1)
}
+
+ // Check preemption, since unlike gc we don't check on every call.
+ // A test case for this one is BenchmarkPingPongHog in proc_test.go.
+ if dfl != nil && getg().preempt {
+ checkPreempt()
+ }
+
return casi
sclose: