Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fixup! worker: implement Web Locks API
  • Loading branch information
addaleax authored and targos committed Dec 14, 2020
commit 949b24d4d930b6599533551f877f3b37a831736b
5 changes: 3 additions & 2 deletions doc/api/worker_threads.md
Original file line number Diff line number Diff line change
Expand Up @@ -320,8 +320,7 @@ The `LockManager` interface provides methods for requesting a new [`Lock`][]
object and querying for an existing `Lock` object. To get an instance of
`LockManager`, call `worker_threads.locks`.

With the exception of `AbortController` support, this implementation matches
the [browser `LockManager`][] API.
This implementation matches the [browser `LockManager`][] API.

#### `locks.request(name[, options], callback)`
<!-- YAML
Expand All @@ -339,6 +338,8 @@ added: REPLACEME
* `steal` {boolean} If `true`, then any held locks with the same name will be
released, and the request will be granted, preempting any queued requests
for it. **Default:** `false`.
* `signal` {AbortSignal} A signal that can be used to abort pending, not-yet
acquired lock requests.
* `callback` {Function} The function to be invoked while the lock is acquired.
The lock will be released when the function ends, or if the function returns
a promise, when that promise settles.
Expand Down