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

Small cleanups in Windows Mutex. #76645

Merged
merged 3 commits into from
Sep 17, 2020

Conversation

m-ou-se
Copy link
Member

@m-ou-se m-ou-se commented Sep 12, 2020

  • Move held into the boxed part, since the SRW lock implementation does not use this. This makes the Mutex 50% smaller.
  • Use Cell instead of UnsafeCell for held, such that .replace() can be used.
  • Add some comments.
  • Avoid creating multiple &muts to the critical section object in ReentrantMutex.

@rust-highfive
Copy link
Collaborator

r? @kennytm

(rust_highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Sep 12, 2020
@jyn514 jyn514 added T-libs Relevant to the library team, which will review and decide on the PR/issue. O-windows Operating system: Windows labels Sep 12, 2020
@m-ou-se m-ou-se closed this Sep 12, 2020
- Move `held` into the boxed part, since the SRW lock implementation
  does not use this. This makes the Mutex 50% smaller.
- Use `Cell` instead of `UnsafeCell` for `held`, such that `.replace()`
  can be used.
- Add some comments.
@m-ou-se m-ou-se changed the title Clean up Windows Mutex implementation. Small cleanups in Windows Mutex. Sep 12, 2020
@m-ou-se m-ou-se reopened this Sep 12, 2020
@m-ou-se m-ou-se marked this pull request as ready for review September 12, 2020 19:04
@kennytm
Copy link
Member

kennytm commented Sep 17, 2020

@bors r+

@bors
Copy link
Contributor

bors commented Sep 17, 2020

📌 Commit 0bb96e7 has been approved by kennytm

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Sep 17, 2020
@bors
Copy link
Contributor

bors commented Sep 17, 2020

⌛ Testing commit 0bb96e7 with merge f3c923a...

@bors
Copy link
Contributor

bors commented Sep 17, 2020

☀️ Test successful - checks-actions, checks-azure
Approved by: kennytm
Pushing f3c923a to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Sep 17, 2020
@bors bors merged commit f3c923a into rust-lang:master Sep 17, 2020
@rustbot rustbot added this to the 1.48.0 milestone Sep 17, 2020
@m-ou-se m-ou-se deleted the windows-lock branch July 24, 2021 08:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. O-windows Operating system: Windows S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-libs Relevant to the library team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants