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

Add lock_arc API to loom Mutex #330

Open
culldanx opened this issue Sep 5, 2023 · 0 comments
Open

Add lock_arc API to loom Mutex #330

culldanx opened this issue Sep 5, 2023 · 0 comments

Comments

@culldanx
Copy link

culldanx commented Sep 5, 2023

ref: https://docs.rs/lock_api/latest/lock_api/struct.Mutex.html#method.lock_arc

If, for example, Mutexes are dynamically generated and stored somewhere, putting them in an Arc adds assurance that even if something mutates the storage (e.g a hashmap), sections of code that have already read and locked the mutex will still hold valid MutexGuards. This is not normally possible due to lifetime constraints

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

No branches or pull requests

1 participant