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

Deprecate try_lock_order, introduce try_lock_explicit[_unchecked] #3

Merged
merged 1 commit into from Jul 10, 2020

Conversation

yvt
Copy link
Contributor

@yvt yvt commented Jul 10, 2020

This is my proposal to address #1.

  • Deprecates the try_lock_order method that is incorrectly marked as a safe function. This allows existing code using try_lock_order to keep compiling, yet encouraging developers to switch to the new, safer alternatives described below. This can be removed after an API-breaking version bump.
  • Introduces the try_lock_explicit method, which panics if the provided orderings are not strong enough.
  • Introduces the try_lock_explicit_unchecked method, which doesn't check the given orderings and thus is marked as unsafe.

Naming these methods as *_explicit was inspired by C11 atomics.

@seanmonstar seanmonstar merged commit f9b9abf into seanmonstar:master Jul 10, 2020
@yvt yvt deleted the fix-order branch October 24, 2021 15:52
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.

None yet

2 participants