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

Rollup of 8 pull requests #71933

Closed
wants to merge 24 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
8f5c66c
Introduce BTreeMap benches of iter itself
ssomers Apr 23, 2020
8730227
Speed up BTreeMap iteration by intertwined descend to the initial lea…
ssomers Apr 22, 2020
4d3cf5b
use new interface to create threads on HermitCore
stlankes Apr 26, 2020
2c43746
use nicer code style to define DEFAULT_MIN_STACK_SIZE
stlankes Apr 27, 2020
19e5da9
SipHasher::new() is literally with SipHasher with both keys being 0
hbina May 1, 2020
9bcf409
x.py: Give a more helpful error message if curl isn't installed
jyn514 May 3, 2020
810c1b4
Define UB in float-to-int casts to saturate
Mark-Simulacrum Apr 18, 2020
5a759f9
Pull in miri test cases
Mark-Simulacrum Apr 18, 2020
2528fa3
Fixup tests to test both const-eval and runtime
Mark-Simulacrum Apr 19, 2020
d65d179
Remove warning about UB
Mark-Simulacrum Apr 21, 2020
61fdd3e
expand comment on default mutex behavior
RalfJung May 4, 2020
40a6b8c
explain our rwlock implementation (and fix a potential data race)
RalfJung May 4, 2020
3f50292
edit Mutex comment
RalfJung May 4, 2020
b83853d
Add command aliases from Cargo to x.py commands
mibac138 May 4, 2020
f9866f9
rely on rdlock/wrlock not returning anything but the specified error …
RalfJung May 5, 2020
3857506
backport 1.43.1 release notes
cuviper May 1, 2020
e2911f9
Rollup merge of #71269 - Mark-Simulacrum:sat-float-casts, r=nikic
Dylan-DPC May 5, 2020
9feb47b
Rollup merge of #71510 - ssomers:btreemap_iter_intertwined, r=Mark-Si…
Dylan-DPC May 5, 2020
ae77058
Rollup merge of #71591 - hermitcore:thread_create, r=hanna-kruppe
Dylan-DPC May 5, 2020
5bd0e21
Rollup merge of #71727 - hbina:simplified_usage, r=Mark-Simulacrum
Dylan-DPC May 5, 2020
7b75c0e
Rollup merge of #71819 - jyn514:check-for-tools, r=Mark-Simulacrum
Dylan-DPC May 5, 2020
2fcdbb6
Rollup merge of #71889 - RalfJung:rwlock, r=Amanieu
Dylan-DPC May 5, 2020
3b3857d
Rollup merge of #71905 - mibac138:x-cmd-alias, r=Mark-Simulacrum
Dylan-DPC May 5, 2020
382faf9
Rollup merge of #71914 - pietroalbini:relnotes-1.43.1, r=Mark-Simulacrum
Dylan-DPC May 5, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
expand comment on default mutex behavior
RalfJung committed May 4, 2020

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit 61fdd3e2bee1ea0f517ff0bfe16f3816decab99a
10 changes: 7 additions & 3 deletions src/libstd/sys/unix/mutex.rs
Original file line number Diff line number Diff line change
@@ -28,14 +28,18 @@ impl Mutex {
//
// 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.
// try to re-lock it from the same thread when you already hold a lock
// (https://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_mutex_init.html).
//
// In practice, glibc takes advantage of this undefined behavior to
// implement hardware lock elision, which uses hardware transactional
// memory to avoid acquiring the lock. While a transaction is in
// memory to avoid acquiring the lock.
// This is the case even if PTHREAD_MUTEX_DEFAULT == PTHREAD_MUTEX_NORMAL
// (https://github.com/rust-lang/rust/issues/33770#issuecomment-220847521).
// As a consequence, while a transaction is in
// progress, the lock appears to be unlocked. This isn't a problem for
// other threads since the transactional memory will abort if a conflict
// is detected, however no abort is generated if re-locking from the
// is detected, however no abort is generated when re-locking from the
// same thread.
//
// Since locking the same mutex twice will result in two aliasing &mut