mirror of https://github.com/nodejs/node.git
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 });
|