GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — test,worker: simplify common.isMainThread · nodejs/node@a29adef

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • test/common
    • index.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎test/common/index.js‎

Copy file name to clipboardExpand all lines: test/common/index.js
+1-7Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,7 @@ const noop = () => {};
4646

4747
const hasCrypto = Boolean(process.versions.openssl);
4848

49-
const isMainThread = (() => {
50-
if (require('module').builtinModules.includes('worker_threads')) {
51-
return require('worker_threads').isMainThread;
52-
}
53-
// Worker module not enabled → only a single main thread exists.
54-
return true;
55-
})();
49+
const { isMainThread } = require('worker_threads');
5650

5751
// Check for flags. Skip this for workers (both, the `cluster` module and
5852
// `worker_threads`) and child processes.

0 commit comments

Comments
0 (0)
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.