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 multiple lock methods for RWLocks #2

Open
Areskiko opened this issue May 22, 2024 · 1 comment
Open

Add multiple lock methods for RWLocks #2

Areskiko opened this issue May 22, 2024 · 1 comment

Comments

@Areskiko
Copy link
Owner

Currently only one lock method can be provided, and it is expected give mutable access to the underlying data. While pure read locks don't make much sense, RWLocks are quite common, so this is an important feature to implement.

@Areskiko
Copy link
Owner Author

The idea is to change how the lock method is specified from

#[lock_method = "lock()"]

to

#[lock_metod("write_lock()", "read_lock()")]

where it is expected that the first method gives mutable access, and the second gives immutable access. The latter one should obviously be allowed to be omitted if it is not applicable.

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