-
Notifications
You must be signed in to change notification settings - Fork 19
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
Define file locking in inactive pages #154
base: main
Are you sure you want to change the base?
Conversation
Instead of immediately failing, "take a lock" will attempt to evict the pages that hold a lock if they are all inactive.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@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|, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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]]: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Uncertain if this is the right condition to exclude workers. This is taken from another PR with BFCache interaction.
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