summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLars-Magnus Skog <ralphtheninja@riseup.net>2018-07-27 16:17:32 +0200
committerGabriel Schulhof <gabriel.schulhof@intel.com>2018-08-28 07:47:08 -0400
commit5081d9663f1ce50d733762b64278d99baa810c04 (patch)
tree34c2f0b28e49b0e2df5c87a38bf2fe1e40412ad2 /src
parentc241f4ac4a59451c44968175753604c2560fdd52 (diff)
downloadandroid-node-v8-5081d9663f1ce50d733762b64278d99baa810c04.tar.gz
android-node-v8-5081d9663f1ce50d733762b64278d99baa810c04.tar.bz2
android-node-v8-5081d9663f1ce50d733762b64278d99baa810c04.zip
n-api: remove idle_running from TsFn
The idle_running member variable in TsFn is always false and can therefore be removed. PR-URL: https://github.com/nodejs/node/pull/22520 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Gabriel Schulhof <gabriel.schulhof@intel.com> Reviewed-By: Gus Caplan <me@gus.host>
Diffstat (limited to 'src')
-rw-r--r--src/node_api.cc18
1 files changed, 6 insertions, 12 deletions
diff --git a/src/node_api.cc b/src/node_api.cc
index 40ebc02798..7b6e43d0ce 100644
--- a/src/node_api.cc
+++ b/src/node_api.cc
@@ -3717,7 +3717,6 @@ class TsFn: public node::AsyncResource {
env(env_),
finalize_data(finalize_data_),
finalize_cb(finalize_cb_),
- idle_running(false),
call_js_cb(call_js_cb_ == nullptr ? CallJs : call_js_cb_),
handles_closing(false) {
ref.Reset(env->isolate, func);
@@ -3879,8 +3878,6 @@ class TsFn: public node::AsyncResource {
} else {
if (uv_idle_stop(&idle) != 0) {
idle_stop_failed = true;
- } else {
- idle_running = false;
}
}
}
@@ -3913,14 +3910,12 @@ class TsFn: public node::AsyncResource {
}
void MaybeStartIdle() {
- if (!idle_running) {
- if (uv_idle_start(&idle, IdleCb) != 0) {
- v8::HandleScope scope(env->isolate);
- CallbackScope cb_scope(this);
- CHECK(napi_throw_error(env,
- "ERR_NAPI_TSFN_START_IDLE_LOOP",
- "Failed to start the idle loop") == napi_ok);
- }
+ if (uv_idle_start(&idle, IdleCb) != 0) {
+ v8::HandleScope scope(env->isolate);
+ CallbackScope cb_scope(this);
+ CHECK(napi_throw_error(env,
+ "ERR_NAPI_TSFN_START_IDLE_LOOP",
+ "Failed to start the idle loop") == napi_ok);
}
}
@@ -4023,7 +4018,6 @@ class TsFn: public node::AsyncResource {
napi_env env;
void* finalize_data;
napi_finalize finalize_cb;
- bool idle_running;
napi_threadsafe_function_call_js call_js_cb;
bool handles_closing;
};