Commit cf6e6abc authored by Ian Lance Taylor's avatar Ian Lance Taylor

runtime: clear js idle timeout before new one and after event handler

Updates #6239
Updates #27707

Change-Id: I0a62c1374db485dd830bf02e59625997d9247fc3
Reviewed-on: https://go-review.googlesource.com/c/go/+/203890
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
parent cc4b824e
......@@ -158,6 +158,7 @@ var idleID int32
// If an event handler returned, we resume it and it will pause the execution.
func beforeIdle(delay int64) bool {
if delay > 0 {
clearIdleID()
if delay < 1e6 {
delay = 1
} else if delay < 1e15 {
......@@ -229,6 +230,7 @@ func handleEvent() {
func handleAsyncEvent() {
isHandlingEvent = true
eventHandler()
clearIdleID()
isHandlingEvent = false
}
......
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