aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/chan.go
diff options
context:
space:
mode:
authorJosh Bleecher Snyder <josharian@gmail.com>2018-03-06 21:28:24 -0800
committerJosh Bleecher Snyder <josharian@gmail.com>2018-03-12 21:56:50 +0000
commit4eea887fd477368653f6fcf8ad766030167936e5 (patch)
treedee030c606077310b3a6abbace192ad2c9bed332 /src/runtime/chan.go
parent025134b0d1b5e5ea2c5216fe4ccb060ab1bea59a (diff)
downloadgo-4eea887fd477368653f6fcf8ad766030167936e5.tar.gz
go-4eea887fd477368653f6fcf8ad766030167936e5.zip
runtime: convert g.waitreason from string to uint8
Every time I poke at #14921, the g.waitreason string pointer writes show up. They're not particularly important performance-wise, but it'd be nice to clear the noise away. And it does open up a few extra bytes in the g struct for some future use. Change-Id: I7ffbd52fbc2a286931a2218038fda52ed6473cc9 Reviewed-on: https://go-review.googlesource.com/99078 Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Austin Clements <austin@google.com>
Diffstat (limited to 'src/runtime/chan.go')
-rw-r--r--src/runtime/chan.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/runtime/chan.go b/src/runtime/chan.go
index 10ee97d924..ce71cee4c5 100644
--- a/src/runtime/chan.go
+++ b/src/runtime/chan.go
@@ -142,7 +142,7 @@ func chansend(c *hchan, ep unsafe.Pointer, block bool, callerpc uintptr) bool {
if !block {
return false
}
- gopark(nil, nil, "chan send (nil chan)", traceEvGoStop, 2)
+ gopark(nil, nil, waitReasonChanSendNilChan, traceEvGoStop, 2)
throw("unreachable")
}
@@ -231,7 +231,7 @@ func chansend(c *hchan, ep unsafe.Pointer, block bool, callerpc uintptr) bool {
gp.waiting = mysg
gp.param = nil
c.sendq.enqueue(mysg)
- goparkunlock(&c.lock, "chan send", traceEvGoBlockSend, 3)
+ goparkunlock(&c.lock, waitReasonChanSend, traceEvGoBlockSend, 3)
// someone woke us up.
if mysg != gp.waiting {
@@ -426,7 +426,7 @@ func chanrecv(c *hchan, ep unsafe.Pointer, block bool) (selected, received bool)
if !block {
return
}
- gopark(nil, nil, "chan receive (nil chan)", traceEvGoStop, 2)
+ gopark(nil, nil, waitReasonChanReceiveNilChan, traceEvGoStop, 2)
throw("unreachable")
}
@@ -517,7 +517,7 @@ func chanrecv(c *hchan, ep unsafe.Pointer, block bool) (selected, received bool)
mysg.c = c
gp.param = nil
c.recvq.enqueue(mysg)
- goparkunlock(&c.lock, "chan receive", traceEvGoBlockRecv, 3)
+ goparkunlock(&c.lock, waitReasonChanReceive, traceEvGoBlockRecv, 3)
// someone woke us up
if mysg != gp.waiting {