From d14cba401a425dc184f929b38442b1d996cdd5f6 Mon Sep 17 00:00:00 2001 From: Gireesh Punathil Date: Sun, 17 Feb 2019 05:24:15 -0500 Subject: 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 --- src/node_messaging.h | 4 ---- 1 file changed, 4 deletions(-) (limited to 'src/node_messaging.h') 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& args); static void PostMessage(const v8::FunctionCallbackInfo& args); @@ -206,7 +203,6 @@ class MessagePort : public HandleWrap { inline uv_async_t* async(); std::unique_ptr data_ = nullptr; - bool stop_event_loop_ = false; friend class MessagePortData; }; -- cgit v1.2.3