aboutsummaryrefslogtreecommitdiff
path: root/src/runtime
diff options
context:
space:
mode:
Diffstat (limited to 'src/runtime')
-rw-r--r--src/runtime/lock_js.go2
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
}