summaryrefslogtreecommitdiff
path: root/lib/internal/worker.js
diff options
context:
space:
mode:
authorAnna Henningsen <anna@addaleax.net>2019-02-01 23:47:38 +0100
committerAnna Henningsen <anna@addaleax.net>2019-02-05 21:55:54 +0100
commit39eca841c30e1a54424b85f34e8dd56b2648f930 (patch)
tree2ab9c7bc285e20f85cefff16c6441c726bbed126 /lib/internal/worker.js
parent8d63f4037e52eda125c5a70dafa602f47c13d0ad (diff)
downloadandroid-node-v8-39eca841c30e1a54424b85f34e8dd56b2648f930.tar.gz
android-node-v8-39eca841c30e1a54424b85f34e8dd56b2648f930.tar.bz2
android-node-v8-39eca841c30e1a54424b85f34e8dd56b2648f930.zip
src: split ownsProcessState off isMainThread
Embedders may want to control whether a Node.js instance controls the current process, similar to what we currently have with `Worker`s. Previously, the `isMainThread` flag had a bit of a double usage, both for indicating whether we are (not) running a Worker and whether we can modify per-process state. PR-URL: https://github.com/nodejs/node/pull/25881 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'lib/internal/worker.js')
-rw-r--r--lib/internal/worker.js8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/internal/worker.js b/lib/internal/worker.js
index f28f4cd663..1d1a5e7d22 100644
--- a/lib/internal/worker.js
+++ b/lib/internal/worker.js
@@ -30,9 +30,10 @@ const { deserializeError } = require('internal/error-serdes');
const { pathToFileURL } = require('url');
const {
- Worker: WorkerImpl,
+ ownsProcessState,
+ isMainThread,
threadId,
- isMainThread
+ Worker: WorkerImpl,
} = internalBinding('worker');
const kHandle = Symbol('kHandle');
@@ -243,7 +244,8 @@ function pipeWithoutWarning(source, dest) {
}
module.exports = {
+ ownsProcessState,
+ isMainThread,
threadId,
Worker,
- isMainThread
};