mirror of
https://github.com/nodejs/node.git
synced 2025-04-28 21:46:48 +00:00

Signed-off-by: James M Snell <jasnell@gmail.com> PR-URL: https://github.com/nodejs/node/pull/38659 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
15 lines
311 B
JavaScript
15 lines
311 B
JavaScript
'use strict';
|
|
|
|
const common = require('../common');
|
|
const assert = require('assert');
|
|
const {
|
|
Worker,
|
|
threadId: parentThreadId,
|
|
} = require('worker_threads');
|
|
|
|
process.on('worker', common.mustCall(({ threadId }) => {
|
|
assert.strictEqual(threadId, parentThreadId + 1);
|
|
}));
|
|
|
|
new Worker('', { eval: true });
|