diff options
author | Ian Lance Taylor <iant@golang.org> | 2019-10-28 17:55:38 -0700 |
---|---|---|
committer | Ian Lance Taylor <iant@golang.org> | 2019-10-30 16:37:41 +0000 |
commit | cf6e6abc68fb1d20475bafaa65d9f96b23ae3773 (patch) | |
tree | 669b9252c9d9d705244eb979694e94c22ea1526e | |
parent | cc4b824e53ef52e1572808c7b7f9b8507516c816 (diff) | |
download | go-git-cf6e6abc68fb1d20475bafaa65d9f96b23ae3773.tar.gz |
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: Brad Fitzpatrick <bradfitz@golang.org>
-rw-r--r-- | src/runtime/lock_js.go | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/runtime/lock_js.go b/src/runtime/lock_js.go index 51cbe60607..df52ea04fd 100644 --- a/src/runtime/lock_js.go +++ b/src/runtime/lock_js.go @@ -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 } |