Multiple improvements to RwLocks by a1phyr · Pull Request #84687 · rust-lang/rust (original) (raw)
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 andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Conversation12 Commits1 Checks0 Files changed
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
[ Show hidden characters]({{ revealButtonHref }})
This PR replicates #77147, #77380 and #84650 on RWLocks :
- Split
sys_common::RWLock
inStaticRWLock
andMovableRWLock
- Unbox rwlocks on some platforms (Windows, Wasm and unsupported)
- Simplify
RwLock::into_inner
Notes to reviewers :
- For each target, I copied
MovableMutex
to guess ifMovableRWLock
should be boxed. A comment says thatStaticMutex
is not re-entrant, I don't understand why and I don't know whether it applies toStaticRWLock
.
r? @m-ou-se
A comment says that
StaticMutex
is not re-entrant, I don't understand why and I don't know whether it applies toStaticRWLock
.
StaticMutex
deadlocks on re-entrancy, but also causes undefined behaviour when locked twice on unix
:
// A pthread mutex initialized with PTHREAD_MUTEX_INITIALIZER will have |
---|
// a type of PTHREAD_MUTEX_DEFAULT, which has undefined behavior if you |
// try to re-lock it from the same thread when you already hold a lock |
StaticRWLock
deadlocks on re-entrancy, but doesn't cause undefined behaviour.
- Split
sys_common::RWLock
betweenStaticRWLock
andMovableRWLock
- Unbox
RwLock
on some platforms (Windows, Wasm and unsupported) - Simplify
RwLock::into_inner
Relevant to the library team, which will review and decide on the PR/issue.
label
Very nice! Thanks!
(Sorry for the late review.)
@bors r+
📌 Commit ac470e9 has been approved by m-ou-se
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
⌛ Testing commit ac470e9 with merge 7ec1035eca280ff57be0c76930820203a694f316...
bors added S-waiting-on-review
Status: Awaiting review from the assignee but also interested parties.
and removed S-waiting-on-bors
Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
labels
A job failed! Check out the build log: (web) (plain)
Click to see the possible cause of the failure (guessed by this bot)
2021-06-08T15:52:15.0727607Z Can't find any online and idle self-hosted runner in current repository that matches the required labels: 'ubuntu-latest'
2021-06-08T15:52:15.1076278Z Can't find any online and idle self-hosted runner in current repository's organization account that matches the required labels: 'ubuntu-latest'
2021-06-08T15:52:15.2176794Z Found online and idle hosted runner in current repository's organization account that matches the required labels: 'ubuntu-latest'
@bors retry
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
bors added a commit to rust-lang-ci/rust that referenced this pull request
Rollup of 7 pull requests
Successful merges:
- rust-lang#82037 (Make symbols stripping work on MacOS X)
- rust-lang#84687 (Multiple improvements to RwLocks)
- rust-lang#85997 (rustdoc: Print a warning if the diff when comparing to old nightlies is empty)
- rust-lang#86051 (Updated code examples and wording in move keyword documentation )
- rust-lang#86111 (fix off by one in
std::iter::Iterator
documentation) - rust-lang#86113 (build doctests with lld if use-lld = true)
- rust-lang#86175 (update Miri)
Failed merges:
r? @ghost
@rustbot
modify labels: rollup
a1phyr deleted the improve_rwlock branch
Labels
Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Relevant to the library team, which will review and decide on the PR/issue.