mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
runtime: record parent goroutine ID, and print it in stack traces
Fixes #38651 Change-Id: Id46d684ee80e208c018791a06c26f304670ed159 Reviewed-on: https://go-review.googlesource.com/c/go/+/435337 Run-TryBot: Nick Ripley <nick.ripley@datadoghq.com> Reviewed-by: Ethan Reesor <ethan.reesor@gmail.com> Auto-Submit: Michael Pratt <mpratt@google.com> Reviewed-by: Michael Pratt <mpratt@google.com> Reviewed-by: Cherry Mui <cherryyz@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
This commit is contained in:
parent
81eda3a339
commit
51225f6fc6
7 changed files with 44 additions and 6 deletions
|
|
@ -540,6 +540,10 @@ func Getg() *G {
|
|||
return getg()
|
||||
}
|
||||
|
||||
func Goid() uint64 {
|
||||
return getg().goid
|
||||
}
|
||||
|
||||
func GIsWaitingOnMutex(gp *G) bool {
|
||||
return readgstatus(gp) == _Gwaiting && gp.waitreason.isMutexWait()
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue