Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 36.4k
worker: implement Web Locks API#36502
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
84ab409949b24d87feb3a0fed56da4f7cf00403239f30da923eaa2ceFile filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -85,6 +85,7 @@ let debug = require('internal/util/debuglog').debuglog('worker', (fn) => { | ||
| }); | ||
| let cwdCounter; | ||
| let locksInitialized = false; | ||
| if (isMainThread) { | ||
| cwdCounter = new Uint32Array(new SharedArrayBuffer(4)); | ||
| @@ -166,6 +167,13 @@ class Worker extends EventEmitter { | ||
| options.env); | ||
| } | ||
| if (isMainThread && !locksInitialized) { | ||
| locksInitialized = true; | ||
| // Make sure that locks are initialized before active | ||
| // multithreading starts. | ||
| require('worker_threads').locks.query(); | ||
Member There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Tiny nit: This is kind of implicit - I would prefer it if this was more explicit (like MemberAuthor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Well … I can add another method, but I don’t think | ||
| } | ||
| // Set up the C++ handle for the worker, as well as some internal wiring. | ||
| this[kHandle] = new WorkerImpl(url, | ||
| env === process.env ? null : env, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. | ||
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.