diff options
author | Austin Clements <austin@google.com> | 2018-08-10 00:09:00 -0400 |
---|---|---|
committer | Austin Clements <austin@google.com> | 2018-08-20 18:19:25 +0000 |
commit | de990545c3ce65926491c123bb2536168cd21cf3 (patch) | |
tree | e5966aff4ace34d0a613af885f22c8da394e7d56 /src/runtime/netpoll_solaris.go | |
parent | 3578918b6614effaeaa581687d810b74e342e0f8 (diff) | |
download | go-de990545c3ce65926491c123bb2536168cd21cf3.tar.gz go-de990545c3ce65926491c123bb2536168cd21cf3.zip |
runtime: use gList in netpoll
netpoll is perhaps one of the most confusing uses of G lists currently
since it passes around many lists as bare *g values right now.
Switching to gList makes it much clearer what's an individual g and
what's a list.
Change-Id: I8d8993c4967c5bae049c7a094aad3a657928ba6c
Reviewed-on: https://go-review.googlesource.com/129397
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Rick Hudson <rlh@golang.org>
Diffstat (limited to 'src/runtime/netpoll_solaris.go')
-rw-r--r-- | src/runtime/netpoll_solaris.go | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/runtime/netpoll_solaris.go b/src/runtime/netpoll_solaris.go index 853e5f63e3..6bd484afaa 100644 --- a/src/runtime/netpoll_solaris.go +++ b/src/runtime/netpoll_solaris.go @@ -180,9 +180,9 @@ func netpollarm(pd *pollDesc, mode int) { // polls for ready network connections // returns list of goroutines that become runnable -func netpoll(block bool) *g { +func netpoll(block bool) gList { if portfd == -1 { - return nil + return gList{} } var wait *timespec @@ -202,7 +202,7 @@ retry: goto retry } - var gp guintptr + var toRun gList for i := 0; i < int(n); i++ { ev := &events[i] @@ -233,12 +233,12 @@ retry: } if mode != 0 { - netpollready(&gp, pd, mode) + netpollready(&toRun, pd, mode) } } - if block && gp == 0 { + if block && toRun.empty() { goto retry } - return gp.ptr() + return toRun } |