diff options
author | Ian Lance Taylor <iant@golang.org> | 2020-03-18 16:32:31 -0700 |
---|---|---|
committer | Ian Lance Taylor <iant@golang.org> | 2020-03-19 00:08:40 +0000 |
commit | b3b174ffcf8ab4977dba1e9e18b91993a8c5a253 (patch) | |
tree | d49c241e1349ed7669ba48e34e6b78dda87d200f /src/runtime/netpoll.go | |
parent | 019421d17fedd4af924dee6b969f2945d64a9eea (diff) | |
download | go-b3b174ffcf8ab4977dba1e9e18b91993a8c5a253.tar.gz go-b3b174ffcf8ab4977dba1e9e18b91993a8c5a253.zip |
runtime: minor updates to netpoll comments
In Go 1.4 we renamed READY to pdReady and WAIT to pdWait as part of
rewriting netpoll from C to Go. Finish updating the comments to use
the new names.
Change-Id: I6cefc698b46c58211fd6be1489bdd70419454962
Reviewed-on: https://go-review.googlesource.com/c/go/+/223998
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Diffstat (limited to 'src/runtime/netpoll.go')
-rw-r--r-- | src/runtime/netpoll.go | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/runtime/netpoll.go b/src/runtime/netpoll.go index 25b1d5d49e..3852598b7e 100644 --- a/src/runtime/netpoll.go +++ b/src/runtime/netpoll.go @@ -39,12 +39,12 @@ import ( // a goroutine consumes the notification by changing the state to nil. // pdWait - a goroutine prepares to park on the semaphore, but not yet parked; // the goroutine commits to park by changing the state to G pointer, -// or, alternatively, concurrent io notification changes the state to READY, +// or, alternatively, concurrent io notification changes the state to pdReady, // or, alternatively, concurrent timeout/close changes the state to nil. // G pointer - the goroutine is blocked on the semaphore; -// io notification or timeout/close changes the state to READY or nil respectively +// io notification or timeout/close changes the state to pdReady or nil respectively // and unparks the goroutine. -// nil - nothing of the above. +// nil - none of the above. const ( pdReady uintptr = 1 pdWait uintptr = 2 @@ -397,7 +397,7 @@ func netpollblock(pd *pollDesc, mode int32, waitio bool) bool { gpp = &pd.wg } - // set the gpp semaphore to WAIT + // set the gpp semaphore to pdWait for { old := *gpp if old == pdReady { @@ -412,13 +412,13 @@ func netpollblock(pd *pollDesc, mode int32, waitio bool) bool { } } - // need to recheck error states after setting gpp to WAIT + // need to recheck error states after setting gpp to pdWait // this is necessary because runtime_pollUnblock/runtime_pollSetDeadline/deadlineimpl // do the opposite: store to closing/rd/wd, membarrier, load of rg/wg if waitio || netpollcheckerr(pd, mode) == 0 { gopark(netpollblockcommit, unsafe.Pointer(gpp), waitReasonIOWait, traceEvGoBlockNet, 5) } - // be careful to not lose concurrent READY notification + // be careful to not lose concurrent pdReady notification old := atomic.Xchguintptr(gpp, 0) if old > pdWait { throw("runtime: corrupted polldesc") @@ -438,7 +438,7 @@ func netpollunblock(pd *pollDesc, mode int32, ioready bool) *g { return nil } if old == 0 && !ioready { - // Only set READY for ioready. runtime_pollWait + // Only set pdReady for ioready. runtime_pollWait // will check for timeout/cancel before waiting. return nil } |