From: Richard Musiol Date: Tue, 11 Dec 2018 12:59:18 +0000 (+0100) Subject: runtime: fix notetsleepg deadline on js/wasm X-Git-Tag: go1.12beta2~66 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=f4f65941246bfee2ef742a5a4920f86d80ab4762;p=gostls13.git runtime: fix notetsleepg deadline on js/wasm A notetsleepg may get stuck if its timeout callback gets invoked exactly on its deadline due to low precision of nanotime. This change fixes the comparison so it also resolves the note if the timestamps are equal. Updates #28975 Change-Id: I045d2f48b7f41cea0caec19b56876e9de01dcd6c Reviewed-on: https://go-review.googlesource.com/c/153558 Run-TryBot: Richard Musiol TryBot-Result: Gobot Gobot Reviewed-by: Ian Lance Taylor --- diff --git a/src/runtime/lock_js.go b/src/runtime/lock_js.go index b04ccdb107..f58c915b63 100644 --- a/src/runtime/lock_js.go +++ b/src/runtime/lock_js.go @@ -127,7 +127,7 @@ func notetsleepg(n *note, ns int64) bool { func checkTimeouts() { now := nanotime() for n, nt := range notesWithTimeout { - if n.key == note_cleared && now > nt.deadline { + if n.key == note_cleared && now >= nt.deadline { n.key = note_timeout goready(nt.gp, 1) }