diff options
| author | bors <bors@rust-lang.org> | 2015-07-03 01:00:31 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2015-07-03 01:00:31 +0000 |
| commit | 4a217759ad5a0ca1ed08e4fec0f278f4e709cdc8 (patch) | |
| tree | 3e47ea0bfd48c38f79d2cbf69bc108f84b1d056d /src/libstd/sys/unix/stack_overflow.rs | |
| parent | f234a6beaa1ee55f6590ec48ac4a5a29b1dfc40a (diff) | |
| parent | d77c4b0fa63d420b2f995e37ee07402f9a243361 (diff) | |
| download | rust-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
