diff options
author | Andy Pan <panjf2000@gmail.com> | 2021-04-15 00:04:17 +0800 |
---|---|---|
committer | Ian Lance Taylor <iant@golang.org> | 2021-04-20 19:48:29 +0000 |
commit | fbb600b28349a41742d35f1d2417c5843c6ba6e4 (patch) | |
tree | 23bafbddd486f93cc7882312d4434b16504f640c /src/runtime/runtime2.go | |
parent | 77860ad2809d88566d28783e0382073fb9836d9b (diff) | |
download | go-fbb600b28349a41742d35f1d2417c5843c6ba6e4.tar.gz go-fbb600b28349a41742d35f1d2417c5843c6ba6e4.zip |
runtime: implement runqdrain() for GC mark worker goroutines
Change-Id: Ida44a2e07f277bee8806538ecee4beee3474cf3d
Reviewed-on: https://go-review.googlesource.com/c/go/+/310149
Reviewed-by: Michael Pratt <mpratt@google.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Trust: Michael Pratt <mpratt@google.com>
Trust: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Michael Pratt <mpratt@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Diffstat (limited to 'src/runtime/runtime2.go')
-rw-r--r-- | src/runtime/runtime2.go | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/runtime/runtime2.go b/src/runtime/runtime2.go index 387841e60b..82b6c596e5 100644 --- a/src/runtime/runtime2.go +++ b/src/runtime/runtime2.go @@ -622,6 +622,9 @@ type p struct { // unit and eliminates the (potentially large) scheduling // latency that otherwise arises from adding the ready'd // goroutines to the end of the run queue. + // + // Note that while other P's may atomically CAS this to zero, + // only the owner P can CAS it to a valid G. runnext guintptr // Available G's (status == Gdead) |