Skip to content

[wgpu-types]: Add cross-platform Mutex and RwLock #7830

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

Open
wants to merge 2 commits into
base: trunk
Choose a base branch
from

Conversation

bushrat011899
Copy link
Contributor

@bushrat011899 bushrat011899 commented Jun 19, 2025

Connections

Description

Across Wgpu's various crates there is a need for locking primitives, such as Mutex and RwLock. Currently, each crate independently imports from either std, parking_lot, or potentially uses a RefCell-based fallback for no_std compatibility. This leads to duplicated implementations of the fallback logic. This PR centralizes these Mutex and RwLock definitions into wgpu-types, allowing them to be re-used across Wgpu. Note that while that is the intention of this PR, currently it just adds the types to wgpu-types; it does not switch the various crates to it. I consider this to be a reasonable split to reduce merge conflicts while the design is reviewed.

Testing

  • CI

Squash or Rebase?

  • Rebase

Checklist

  • Run cargo fmt.
  • Run taplo format.
  • Run cargo clippy --tests. If applicable, add:
    • --target wasm32-unknown-unknown
  • Run cargo xtask test to run tests.
  • If this contains user-facing changes, add a CHANGELOG.md entry.

@bushrat011899 bushrat011899 requested a review from a team as a code owner June 19, 2025 01:44
@bushrat011899 bushrat011899 mentioned this pull request Jun 19, 2025
6 tasks
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