Define file locking in inactive pages#154
Open
nathanmemmott wants to merge 4 commits intowhatwg:mainfrom
Open
Conversation
added 4 commits
December 19, 2023 15:17
Instead of immediately failing, "take a lock" will attempt to evict the pages that hold a lock if they are all inactive.
nathanmemmott
commented
Jan 3, 2024
Contributor
Author
nathanmemmott
left a comment
There was a problem hiding this comment.
@a-sully Can you PTAL at this PR?
| 1. Return "`success`". | ||
| 1. Return "`failure`". | ||
| To <dfn for="file entry" id=file-entry-lock-take>take a lock</dfn> on a given [=file entry=] |file| | ||
| with a |lockType| (a [=lock type=]), a set of steps |resultSteps|, a [=realm/global object=] |global|, |
Contributor
Author
There was a problem hiding this comment.
I couldn't find an example of a spec algorithm which took steps and passed a result to them. I thought about returning the result, but the steps will be run before the algorithm returns.
| 1. [=set/For each=] |global| of |lock|'s [=file lock/globals=]: | ||
| 1. If |global| is a {{Window}} object whose [=associated Document=] is [=Document/fully active=]: | ||
| 1. Return "`failure`". | ||
| 1. If |global| is a {{WorkerGlobalScope}} object whose [=WorkerGlobalScope/closing=] flag is false and whose {{worker}} is not a [[html/workers#the-worker's-lifetime|suspendable worker]]: |
Contributor
Author
There was a problem hiding this comment.
Uncertain if this is the right condition to exclude workers. This is taken from another PR with BFCache interaction.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Instead of immediately failing, "take a lock" will attempt to evict the pages that hold a lock if they are all inactive. This prevents an inactive page from holding onto locks needed by active pages.
Fixes issue #17
(See WHATWG Working Mode: Changes for more details.)
Preview | Diff