@@ -3717,7 +3717,6 @@ class TsFn: public node::AsyncResource { |
3717 | 3717 | env(env_), |
3718 | 3718 | finalize_data(finalize_data_), |
3719 | 3719 | finalize_cb(finalize_cb_), |
3720 | | - idle_running(false), |
3721 | 3720 | call_js_cb(call_js_cb_ == nullptr ? CallJs : call_js_cb_), |
3722 | 3721 | handles_closing(false) { |
3723 | 3722 | ref.Reset(env->isolate, func); |
@@ -3879,8 +3878,6 @@ class TsFn: public node::AsyncResource { |
3879 | 3878 | } else { |
3880 | 3879 | if (uv_idle_stop(&idle) != 0) { |
3881 | 3880 | idle_stop_failed = true; |
3882 | | - } else { |
3883 | | - idle_running = false; |
3884 | 3881 | } |
3885 | 3882 | } |
3886 | 3883 | } |
@@ -3913,14 +3910,12 @@ class TsFn: public node::AsyncResource { |
3913 | 3910 | } |
3914 | 3911 |
|
3915 | 3912 | void MaybeStartIdle() { |
3916 | | - if (!idle_running) { |
3917 | | - if (uv_idle_start(&idle, IdleCb) != 0) { |
3918 | | - v8::HandleScope scope(env->isolate); |
3919 | | - CallbackScope cb_scope(this); |
3920 | | - CHECK(napi_throw_error(env, |
3921 | | - "ERR_NAPI_TSFN_START_IDLE_LOOP", |
3922 | | - "Failed to start the idle loop") == napi_ok); |
3923 | | - } |
| 3913 | + if (uv_idle_start(&idle, IdleCb) != 0) { |
| 3914 | + v8::HandleScope scope(env->isolate); |
| 3915 | + CallbackScope cb_scope(this); |
| 3916 | + CHECK(napi_throw_error(env, |
| 3917 | + "ERR_NAPI_TSFN_START_IDLE_LOOP", |
| 3918 | + "Failed to start the idle loop") == napi_ok); |
3924 | 3919 | } |
3925 | 3920 | } |
3926 | 3921 |
|
@@ -4023,7 +4018,6 @@ class TsFn: public node::AsyncResource { |
4023 | 4018 | napi_env env; |
4024 | 4019 | void* finalize_data; |
4025 | 4020 | napi_finalize finalize_cb; |
4026 | | - bool idle_running; |
4027 | 4021 | napi_threadsafe_function_call_js call_js_cb; |
4028 | 4022 | bool handles_closing; |
4029 | 4023 | }; |
|