Commit 58d76217 authored by Russ Cox's avatar Russ Cox

runtime: run mutexevent profiling without holding semaRoot lock

Suggested by Dmitry in CL 36792 review.
Clearly safe since there are many different semaRoots
that could all have profiled sudogs calling mutexevent.

Change-Id: I45eed47a5be3e513b2dad63b60afcd94800e16d1
Reviewed-on: https://go-review.googlesource.com/37104
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
Reviewed-by: default avatarDmitry Vyukov <dvyukov@google.com>
parent 83f95b85
......@@ -174,13 +174,14 @@ func semrelease(addr *uint32) {
s, t0 := root.dequeue(addr)
if s != nil {
atomic.Xadd(&root.nwait, -1)
if s.acquiretime != 0 {
mutexevent(t0-s.acquiretime, 3)
}
}
unlock(&root.lock)
if s != nil { // May be slow, so unlock first
acquiretime := s.acquiretime
readyWithTime(s, 5)
if acquiretime != 0 {
mutexevent(t0-acquiretime, 3)
}
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment