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

LibThread: remove redundant atomic write/ read from atomic in Lock #3013

Merged
merged 1 commit into from
Aug 6, 2020

Conversation

tryfinally
Copy link
Contributor

m_holder.compare_exchange_strong(expected, desired, ...)
will either:

  • successfully update the value to desired if it equals expected
    and no need to write the tid again.
  • or read the current value into expected otherwise.

… Lock

m_holder.compare_exchange_strong(expected, desired, ...)
will either successfully update the value to desired if == expected
or put the current value in expected otherwise
@awesomekling awesomekling merged commit 5fe6c13 into SerenityOS:master Aug 6, 2020
@tryfinally tryfinally deleted the dev-libThread-fix branch August 7, 2020 15:04
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