summaryrefslogtreecommitdiff
path: root/src/node_messaging.h
diff options
context:
space:
mode:
authorGireesh Punathil <gpunathi@in.ibm.com>2019-02-17 05:24:15 -0500
committerAnna Henningsen <anna@addaleax.net>2019-03-01 10:14:55 +0100
commitd14cba401a425dc184f929b38442b1d996cdd5f6 (patch)
treee93f00fee2d16af2bf873a793309cd4c2a64016b /src/node_messaging.h
parent584305841d0fabee5d96ae43badfa271da99a19f (diff)
downloadandroid-node-v8-d14cba401a425dc184f929b38442b1d996cdd5f6.tar.gz
android-node-v8-d14cba401a425dc184f929b38442b1d996cdd5f6.tar.bz2
android-node-v8-d14cba401a425dc184f929b38442b1d996cdd5f6.zip
worker: refactor thread life cycle management
The current mechanism of uses two async handles, one owned by the creator of the worker thread to terminate a running worker, and another one employed by the worker to interrupt its creator on its natural termination. The force termination piggybacks on the message- passing mechanism to inform the worker to quiesce. Also there are few flags that represent the other thread's state / request state because certain code path is shared by multiple control flows, and there are certain code path where the async handles may not have come to life. Refactor into an AsyncRequest abstraction that exposes routines to install a handle as well as to save a state. PR-URL: https://github.com/nodejs/node/pull/26099 Refs: https://github.com/nodejs/node/pull/21283 Reviewed-By: Anna Henningsen <anna@addaleax.net>
Diffstat (limited to 'src/node_messaging.h')
-rw-r--r--src/node_messaging.h4
1 files changed, 0 insertions, 4 deletions
diff --git a/src/node_messaging.h b/src/node_messaging.h
index cfda69ae7f..9055a8bf96 100644
--- a/src/node_messaging.h
+++ b/src/node_messaging.h
@@ -159,9 +159,6 @@ class MessagePort : public HandleWrap {
void Start();
// Stop processing messages on this port as a receiving end.
void Stop();
- // Stop processing messages on this port as a receiving end,
- // and stop the event loop that this port is associated with.
- void StopEventLoop();
static void New(const v8::FunctionCallbackInfo<v8::Value>& args);
static void PostMessage(const v8::FunctionCallbackInfo<v8::Value>& args);
@@ -206,7 +203,6 @@ class MessagePort : public HandleWrap {
inline uv_async_t* async();
std::unique_ptr<MessagePortData> data_ = nullptr;
- bool stop_event_loop_ = false;
friend class MessagePortData;
};