about summary refs log tree commit diff
path: root/src/libstd/sys/unix/stack_overflow.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2015-07-03 01:00:31 +0000
committerbors <bors@rust-lang.org>2015-07-03 01:00:31 +0000
commit4a217759ad5a0ca1ed08e4fec0f278f4e709cdc8 (patch)
tree3e47ea0bfd48c38f79d2cbf69bc108f84b1d056d /src/libstd/sys/unix/stack_overflow.rs
parentf234a6beaa1ee55f6590ec48ac4a5a29b1dfc40a (diff)
parentd77c4b0fa63d420b2f995e37ee07402f9a243361 (diff)
downloadrust-4a217759ad5a0ca1ed08e4fec0f278f4e709cdc8.tar.gz
rust-4a217759ad5a0ca1ed08e4fec0f278f4e709cdc8.zip
Auto merge of #26610 - aturon:fix_make_unique, r=alexcrichton
This commit resolves the race condition in the `get_mut` and
`make_unique` functions, which arose through interaction with weak
pointers. The basic strategy is to "lock" the weak pointer count when
trying to establish uniqueness, by reusing the field as a simple
spinlock. The overhead for normal use of `Arc` is expected to be minimal
-- it will be *none* when only strong pointers are used, and only
requires a move from atomic increment to CAS for usage of weak pointers.

The commit also removes the `unsafe` and deprecated status of these functions.

Closes #24880

r? @alexcrichton 

cc @metajack @SimonSapin @Ms2ger 
Diffstat (limited to 'src/libstd/sys/unix/stack_overflow.rs')
0 files changed, 0 insertions, 0 deletions