aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/netpoll_solaris.go
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2015-04-17 00:21:30 -0400
committerRuss Cox <rsc@golang.org>2015-04-20 20:20:09 +0000
commit181e26b9fa3c85ca5a512a51278b3f22f6e64dc9 (patch)
tree441826cbaff52d78373d650977d3c0cfd619054a /src/runtime/netpoll_solaris.go
parentc776592a4ff17b2153492bf5b17ae3151a42abf0 (diff)
downloadgo-181e26b9fa3c85ca5a512a51278b3f22f6e64dc9.tar.gz
go-181e26b9fa3c85ca5a512a51278b3f22f6e64dc9.zip
runtime: replace func-based write barrier skipping with type-based
This CL revises CL 7504 to use explicitly uintptr types for the struct fields that are going to be updated sometimes without write barriers. The result is that the fields are now updated *always* without write barriers. This approach has two important properties: 1) Now the GC never looks at the field, so if the missing reference could cause a problem, it will do so all the time, not just when the write barrier is missed at just the right moment. 2) Now a write barrier never happens for the field, avoiding the (correct) detection of inconsistent write barriers when GODEBUG=wbshadow=1. Change-Id: Iebd3962c727c0046495cc08914a8dc0808460e0e Reviewed-on: https://go-review.googlesource.com/9019 Reviewed-by: Austin Clements <austin@google.com> Run-TryBot: Russ Cox <rsc@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
Diffstat (limited to 'src/runtime/netpoll_solaris.go')
-rw-r--r--src/runtime/netpoll_solaris.go12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/runtime/netpoll_solaris.go b/src/runtime/netpoll_solaris.go
index d8f050e1e2..abfe56d801 100644
--- a/src/runtime/netpoll_solaris.go
+++ b/src/runtime/netpoll_solaris.go
@@ -179,9 +179,9 @@ var netpolllasterr int32
// polls for ready network connections
// returns list of goroutines that become runnable
-func netpoll(block bool) (gp *g) {
+func netpoll(block bool) *g {
if portfd == -1 {
- return
+ return nil
}
var wait *timespec
@@ -201,7 +201,7 @@ retry:
goto retry
}
- gp = nil
+ var gp guintptr
for i := 0; i < int(n); i++ {
ev := &events[i]
@@ -232,12 +232,12 @@ retry:
}
if mode != 0 {
- netpollready((**g)(noescape(unsafe.Pointer(&gp))), pd, mode)
+ netpollready(&gp, pd, mode)
}
}
- if block && gp == nil {
+ if block && gp == 0 {
goto retry
}
- return gp
+ return gp.ptr()
}