diff options
Diffstat (limited to 'libgo/go/runtime/time.go')
-rw-r--r-- | libgo/go/runtime/time.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libgo/go/runtime/time.go b/libgo/go/runtime/time.go index a69db99..327726c 100644 --- a/libgo/go/runtime/time.go +++ b/libgo/go/runtime/time.go @@ -262,6 +262,9 @@ func addtimer(t *timer) { when := t.when + // Disable preemption while using pp to avoid changing another P's heap. + mp := acquirem() + pp := getg().m.p.ptr() lock(&pp.timersLock) cleantimers(pp) @@ -269,6 +272,8 @@ func addtimer(t *timer) { unlock(&pp.timersLock) wakeNetPoller(when) + + releasem(mp) } // doaddtimer adds t to the current P's heap. |