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

Make export::acquire() and export::release() unsafe #659

Merged
merged 3 commits into from
Feb 15, 2022

Conversation

jannic
Copy link
Contributor

@jannic jannic commented Feb 10, 2022

Calling export::release() may enable interrupts, which is unsound
if done inside a critical section or other code which expects interrupts
to be disabled.

Calling export::acquire() is less dangerous (no obvious way to cause
unsoundness), but is still a bad idea and breaks the safety contract
of critical_section::acquire(), which must only be called paired with
critical_section::release().

Calling export::release() may enable interrupts, which is unsound
if done inside a critical section or other code which expects interrupts
to be disabled.

Calling export::acquire() is less dangerous (no obvious way to cause
unsoundness), but is still a bad idea and breaks the safety contract
of critical_section::acquire(), which must only be called paired with
critical_section::release().
@jannic jannic marked this pull request as ready for review February 10, 2022 23:06
@Urhengulas
Copy link
Member

Thank you!

bors r+

@bors
Copy link
Contributor

bors bot commented Feb 15, 2022

Build succeeded:

@bors bors bot merged commit 6f89322 into knurling-rs:main Feb 15, 2022
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.

2 participants