]> Cypherpunks repositories - gostls13.git/commit
runtime: replace manually managed G dequeues with a type
authorAustin Clements <austin@google.com>
Fri, 10 Aug 2018 03:47:37 +0000 (23:47 -0400)
committerAustin Clements <austin@google.com>
Mon, 20 Aug 2018 18:19:22 +0000 (18:19 +0000)
commit3578918b6614effaeaa581687d810b74e342e0f8
tree555f4a6154463a0434bd2b7bd1be521306007a63
parent723479bc30f998f29ecbba7caea118ac4e2c9afd
runtime: replace manually managed G dequeues with a type

There are two manually managed G dequeues. Abstract these both into a
shared gQueue type. This also introduces a gList type, which we'll use
to replace several manually-managed G lists in follow-up CLs.

This makes the code more readable and maintainable. gcFlushBgCredit in
particular becomes much easier to follow. It also makes it easier to
introduce more G queues in the future. Finally, the gList type clearly
distinguishes between lists of Gs and individual Gs; currently both
are represented by a *g, which can easily lead to confusion and bugs.

Change-Id: Ic7798841b405d311fc8b6aa5a958ffa4c7993c6c
Reviewed-on: https://go-review.googlesource.com/129396
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Rick Hudson <rlh@golang.org>
src/runtime/mgc.go
src/runtime/mgcmark.go
src/runtime/proc.go
src/runtime/runtime2.go