Skip to content
Closed
Changes from 1 commit
Commits
Show all changes
23 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
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
75f066d
Handle binop on unbound type param
estebank Apr 7, 2020
1473a66
Suggest restricting type param when it doesn't satisfy projection
estebank Apr 7, 2020
3453db7
review comments: use or-pattern
estebank Apr 7, 2020
d8d02f8
On incorrect equality constraint likely to be assoc type, suggest app…
estebank Apr 8, 2020
c93c660
review comments and rebase fix
estebank Apr 17, 2020
5d64e91
review comment: use `body_id`
estebank Apr 19, 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
b13f234
fix rebase
estebank May 4, 2020
b17b20c
Add docstring to `deny_equality_constraints`
estebank 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
793f921
Rollup merge of #70908 - estebank:suggest-add, r=nikomatsakis
Dylan-DPC May 5, 2020
d329f74
Rollup merge of #71510 - ssomers:btreemap_iter_intertwined, r=Mark-Si…
Dylan-DPC May 5, 2020
61ac8a1
Rollup merge of #71727 - hbina:simplified_usage, r=Mark-Simulacrum
Dylan-DPC May 5, 2020
1ed91a2
Rollup merge of #71819 - jyn514:check-for-tools, r=Mark-Simulacrum
Dylan-DPC May 5, 2020
c879b32
Rollup merge of #71889 - RalfJung:rwlock, r=Amanieu
Dylan-DPC May 5, 2020
bd89441
Rollup merge of #71905 - mibac138:x-cmd-alias, 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
edit Mutex comment
  • Loading branch information
RalfJung committed May 4, 2020
commit 3f50292edce92fb889bcd7318fead1a8905b6342
10 changes: 6 additions & 4 deletions src/libstd/sys/unix/mutex.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,15 @@ impl Mutex {
// 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
// (https://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_mutex_init.html).
// This is the case even if PTHREAD_MUTEX_DEFAULT == PTHREAD_MUTEX_NORMAL
// (https://github.com/rust-lang/rust/issues/33770#issuecomment-220847521) -- in that
// case, `pthread_mutexattr_settype(PTHREAD_MUTEX_DEFAULT)` will of course be the same
// as setting it to `PTHREAD_MUTEX_NORMAL`, but not setting any mode will result in
// a Mutex where re-locking is UB.
//
// In practice, glibc takes advantage of this undefined behavior to
// implement hardware lock elision, which uses hardware transactional
// 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
// memory to avoid acquiring the lock. 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 when re-locking from the
Expand Down