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

LibWeb: Add basic non-blocking Web-Locks #3913

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

boginw
Copy link

@boginw boginw commented Mar 12, 2025

This PR introduces a basic non-blocking Web-locks.

No locking mechanism has been implemented, so acquiring a lock always immediately allows access to the exclusive zone. Leaving the actual locking mechanism and queue as future work.

Tests:

  • web-locks/acquire.https.any.html passes 10 out of its 11 tests

    • The remaining failing test calls .request with a wrong number of arguments and expects the promise to reject, but the generated prototype throws a synchronus TypeError instead. Don't know how to handle that.
  • web-locks/acquire.https.any.worker.html cannot run

    • Running it the browser shows that it also passes 10/11 tests, but I couldn't figure out how to properly import these, getting stuck on:
     Failed load of: "file:///web-locks/acquire.https.any.worker.js", Error: No such file or directory (errno=2), Duration: 0ms
    
  • web-locks/lock-attributes.https.any.html passes 2 out of its 2 tests

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant