diff options
author | ian <ian@138bc75d-0d04-0410-961f-82ee72b054a4> | 2018-02-23 22:36:54 +0000 |
---|---|---|
committer | ian <ian@138bc75d-0d04-0410-961f-82ee72b054a4> | 2018-02-23 22:36:54 +0000 |
commit | 88a3ea34080ad3087a8191fbf479543153175d59 (patch) | |
tree | 34eaec34d3588e09f9a77abba776266f124dc823 /libgo/go/runtime/chan.go | |
parent | 25e15aaed275cdfef34b3ee6eb3cb4b43a48d44f (diff) | |
parent | e65055a558093bd4fc0b1b0024b7814cc187b8e8 (diff) | |
download | gccgo.tar.gz |
Merge from trunk revision 257954.gccgo
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gccgo@257955 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgo/go/runtime/chan.go')
-rw-r--r-- | libgo/go/runtime/chan.go | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/libgo/go/runtime/chan.go b/libgo/go/runtime/chan.go index bf708aec5c4..87f7879e6f5 100644 --- a/libgo/go/runtime/chan.go +++ b/libgo/go/runtime/chan.go @@ -148,6 +148,11 @@ func chansend1(c *hchan, elem unsafe.Pointer) { * the operation; we'll see that it's now closed. */ func chansend(c *hchan, ep unsafe.Pointer, block bool, callerpc uintptr) bool { + // Check preemption, since unlike gc we don't check on every call. + if getg().preempt { + checkPreempt() + } + if c == nil { if !block { return false @@ -430,6 +435,11 @@ func chanrecv(c *hchan, ep unsafe.Pointer, block bool) (selected, received bool) print("chanrecv: chan=", c, "\n") } + // Check preemption, since unlike gc we don't check on every call. + if getg().preempt { + checkPreempt() + } + if c == nil { if !block { return |