WebLocksSessionLock is the default SessionLock, backed by the Web
Locks API (navigator.locks.request with { ifAvailable: true }).
A Web Lock is held for as long as the promise returned from the request's
callback stays pending. To hold the lock for the whole attachment lifetime,
acquire keeps that callback pending on a promise that only resolves when the
returned handle's release is called. When the lock is already held (another
tab), ifAvailable invokes the callback with a null lock and acquire
resolves undefined — the fail-fast signal.
When the Web Locks API is unavailable (non-browser runtimes), this is a no-op:
acquire always resolves a handle whose release does nothing, so it never
breaks non-browser usage. Multi-tab safety simply does not apply there.
WebLocksSessionLockis the default SessionLock, backed by the Web Locks API (navigator.locks.requestwith{ ifAvailable: true }).A Web Lock is held for as long as the promise returned from the request's callback stays pending. To hold the lock for the whole attachment lifetime,
acquirekeeps that callback pending on a promise that only resolves when the returned handle'sreleaseis called. When the lock is already held (another tab),ifAvailableinvokes the callback with anulllock andacquireresolvesundefined— the fail-fast signal.When the Web Locks API is unavailable (non-browser runtimes), this is a no-op:
acquirealways resolves a handle whosereleasedoes nothing, so it never breaks non-browser usage. Multi-tab safety simply does not apply there.