Skip to content

Commit b3b174f

Browse files
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>
1 parent 019421d commit b3b174f

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/runtime/netpoll.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,12 @@ import (
3939
// a goroutine consumes the notification by changing the state to nil.
4040
// pdWait - a goroutine prepares to park on the semaphore, but not yet parked;
4141
// the goroutine commits to park by changing the state to G pointer,
42-
// or, alternatively, concurrent io notification changes the state to READY,
42+
// or, alternatively, concurrent io notification changes the state to pdReady,
4343
// or, alternatively, concurrent timeout/close changes the state to nil.
4444
// G pointer - the goroutine is blocked on the semaphore;
45-
// io notification or timeout/close changes the state to READY or nil respectively
45+
// io notification or timeout/close changes the state to pdReady or nil respectively
4646
// and unparks the goroutine.
47-
// nil - nothing of the above.
47+
// nil - none of the above.
4848
const (
4949
pdReady uintptr = 1
5050
pdWait uintptr = 2
@@ -397,7 +397,7 @@ func netpollblock(pd *pollDesc, mode int32, waitio bool) bool {
397397
gpp = &pd.wg
398398
}
399399

400-
// set the gpp semaphore to WAIT
400+
// set the gpp semaphore to pdWait
401401
for {
402402
old := *gpp
403403
if old == pdReady {
@@ -412,13 +412,13 @@ func netpollblock(pd *pollDesc, mode int32, waitio bool) bool {
412412
}
413413
}
414414

415-
// need to recheck error states after setting gpp to WAIT
415+
// need to recheck error states after setting gpp to pdWait
416416
// this is necessary because runtime_pollUnblock/runtime_pollSetDeadline/deadlineimpl
417417
// do the opposite: store to closing/rd/wd, membarrier, load of rg/wg
418418
if waitio || netpollcheckerr(pd, mode) == 0 {
419419
gopark(netpollblockcommit, unsafe.Pointer(gpp), waitReasonIOWait, traceEvGoBlockNet, 5)
420420
}
421-
// be careful to not lose concurrent READY notification
421+
// be careful to not lose concurrent pdReady notification
422422
old := atomic.Xchguintptr(gpp, 0)
423423
if old > pdWait {
424424
throw("runtime: corrupted polldesc")
@@ -438,7 +438,7 @@ func netpollunblock(pd *pollDesc, mode int32, ioready bool) *g {
438438
return nil
439439
}
440440
if old == 0 && !ioready {
441-
// Only set READY for ioready. runtime_pollWait
441+
// Only set pdReady for ioready. runtime_pollWait
442442
// will check for timeout/cancel before waiting.
443443
return nil
444444
}

0 commit comments

Comments
 (0)