@@ -3614,7 +3614,6 @@ class TsFn: public node::AsyncResource {
36143614 env(env_),
36153615 finalize_data(finalize_data_),
36163616 finalize_cb(finalize_cb_),
3617- idle_running(false ),
36183617 call_js_cb(call_js_cb_ == nullptr ? CallJs : call_js_cb_),
36193618 handles_closing(false ) {
36203619 ref.Reset (env->isolate , func);
@@ -3779,8 +3778,6 @@ class TsFn: public node::AsyncResource {
37793778 } else {
37803779 if (uv_idle_stop (&idle) != 0 ) {
37813780 idle_stop_failed = true ;
3782- } else {
3783- idle_running = false ;
37843781 }
37853782 }
37863783 }
@@ -3813,14 +3810,12 @@ class TsFn: public node::AsyncResource {
38133810 }
38143811
38153812 void MaybeStartIdle () {
3816- if (!idle_running) {
3817- if (uv_idle_start (&idle, IdleCb) != 0 ) {
3818- v8::HandleScope scope (env->isolate );
3819- CallbackScope cb_scope (this );
3820- CHECK (napi_throw_error (env,
3821- " ERR_NAPI_TSFN_START_IDLE_LOOP" ,
3822- " Failed to start the idle loop" ) == napi_ok);
3823- }
3813+ if (uv_idle_start (&idle, IdleCb) != 0 ) {
3814+ v8::HandleScope scope (env->isolate );
3815+ CallbackScope cb_scope (this );
3816+ CHECK (napi_throw_error (env,
3817+ " ERR_NAPI_TSFN_START_IDLE_LOOP" ,
3818+ " Failed to start the idle loop" ) == napi_ok);
38243819 }
38253820 }
38263821
@@ -3923,7 +3918,6 @@ class TsFn: public node::AsyncResource {
39233918 napi_env env;
39243919 void * finalize_data;
39253920 napi_finalize finalize_cb;
3926- bool idle_running;
39273921 napi_threadsafe_function_call_js call_js_cb;
39283922 bool handles_closing;
39293923};
0 commit comments