aboutsummaryrefslogtreecommitdiff
path: root/libgo/go/runtime/proc.go
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@gcc.gnu.org>2018-02-20 15:30:31 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>2018-02-20 15:30:31 +0000
commit911cef2e3ba7548ee13e761f88457c6bbe1fa7fe (patch)
tree140f7eca6d15defccbef94b9bfa5d41e30168520 /libgo/go/runtime/proc.go
parent9bd958c5f361337b15958be8641d59ad38bd0a2b (diff)
downloadgcc-911cef2e3ba7548ee13e761f88457c6bbe1fa7fe.zip
gcc-911cef2e3ba7548ee13e761f88457c6bbe1fa7fe.tar.gz
gcc-911cef2e3ba7548ee13e761f88457c6bbe1fa7fe.tar.bz2
runtime: allow preemption in fast syscall return
Let a fast syscall return be a preemption point. This helps with tight loops that make system calls, as in BenchmarkSyscallExcessWork. Reviewed-on: https://go-review.googlesource.com/94895 From-SVN: r257848
Diffstat (limited to 'libgo/go/runtime/proc.go')
-rw-r--r--libgo/go/runtime/proc.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/libgo/go/runtime/proc.go b/libgo/go/runtime/proc.go
index 1d95109..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
}