aboutsummaryrefslogtreecommitdiff
path: root/libgo/go/runtime/proc.go
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@gcc.gnu.org>2018-02-23 22:36:54 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>2018-02-23 22:36:54 +0000
commit48ec607c1f8d1f1783850f1d2729fd23716b1b1b (patch)
tree34eaec34d3588e09f9a77abba776266f124dc823 /libgo/go/runtime/proc.go
parentcb1ee43f1c87cc08bb7f930138fba0476879499a (diff)
parent8af2826bb0cd48d90dc04fc044a9ddbf978a5281 (diff)
downloadgcc-48ec607c1f8d1f1783850f1d2729fd23716b1b1b.zip
gcc-48ec607c1f8d1f1783850f1d2729fd23716b1b1b.tar.gz
gcc-48ec607c1f8d1f1783850f1d2729fd23716b1b1b.tar.bz2
Merge from trunk revision 257954.
From-SVN: r257955
Diffstat (limited to 'libgo/go/runtime/proc.go')
-rw-r--r--libgo/go/runtime/proc.go12
1 files changed, 10 insertions, 2 deletions
diff --git a/libgo/go/runtime/proc.go b/libgo/go/runtime/proc.go
index edf4140..20fa0ad 100644
--- a/libgo/go/runtime/proc.go
+++ b/libgo/go/runtime/proc.go
@@ -2794,6 +2794,13 @@ func exitsyscall(dummy int32) {
exitsyscallclear(_g_)
_g_.m.locks--
_g_.throwsplit = false
+
+ // Check preemption, since unlike gc we don't check on
+ // every call.
+ if getg().preempt {
+ checkPreempt()
+ }
+
return
}
@@ -4084,8 +4091,9 @@ func preemptone(_p_ *p) bool {
// setting a global variable and figuring out a way to efficiently
// check that global variable.
//
- // For now we check gp.preempt in schedule and mallocgc,
- // which is at least better than doing nothing at all.
+ // For now we check gp.preempt in schedule, mallocgc, selectgo,
+ // and a few other places, which is at least better than doing
+ // nothing at all.
return true
}