diff options
author | Darshan Sen <raisinten@gmail.com> | 2022-04-20 02:27:14 +0300 |
---|---|---|
committer | Michaƫl Zasso <targos@protonmail.com> | 2022-04-28 07:56:13 +0300 |
commit | c3922afa1c9acad431812a1bd45725ae3410522b (patch) | |
tree | 851fcc72042e15e56f03af6432f8d75b50bf3ece /src/node_worker.h | |
parent | 7c973474bf24cf58db4f9242e3683514e33a7c71 (diff) |
worker: add hasRef() to the handle object
This should help projects like
https://github.com/mafintosh/why-is-node-running and
https://github.com/facebook/jest to detect if Worker instances are
keeping the event loop active correctly.
Fixes: https://github.com/nodejs/node/issues/42091
Refs: https://github.com/mafintosh/why-is-node-running/issues/59
Signed-off-by: Darshan Sen <raisinten@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/42756
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Diffstat (limited to 'src/node_worker.h')
-rw-r--r-- | src/node_worker.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/node_worker.h b/src/node_worker.h index d400c4c991d..f2a9386aeab 100644 --- a/src/node_worker.h +++ b/src/node_worker.h @@ -61,6 +61,7 @@ class Worker : public AsyncWrap { static void SetEnvVars(const v8::FunctionCallbackInfo<v8::Value>& args); static void StartThread(const v8::FunctionCallbackInfo<v8::Value>& args); static void StopThread(const v8::FunctionCallbackInfo<v8::Value>& args); + static void HasRef(const v8::FunctionCallbackInfo<v8::Value>& args); static void Ref(const v8::FunctionCallbackInfo<v8::Value>& args); static void Unref(const v8::FunctionCallbackInfo<v8::Value>& args); static void GetResourceLimits( |