Skip to content
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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

nathanmemmott
Copy link
Contributor

@nathanmemmott nathanmemmott commented Dec 20, 2023

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

Nathan Memmott 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.
Copy link
Contributor Author

@nathanmemmott nathanmemmott left a 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|,
Copy link
Contributor Author

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]]:
Copy link
Contributor Author

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.

@a-sully a-sully self-requested a review January 4, 2024 17:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant