diff options
| author | bors <bors@rust-lang.org> | 2014-08-01 22:05:58 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2014-08-01 22:05:58 +0000 |
| commit | 292caefb26c7f99a064a1ed6a8ba37ec5375e88e (patch) | |
| tree | e00782f524dccaa0fd75db74c97fc7c3d33e2795 /src/libsyntax/parse | |
| parent | 55b24051be0c7ee7ebfddece0d58f3f9279bffa5 (diff) | |
| parent | 7b817b6ab97f31d96dc935278fa4d34e4b510782 (diff) | |
| download | rust-292caefb26c7f99a064a1ed6a8ba37ec5375e88e.tar.gz rust-292caefb26c7f99a064a1ed6a8ba37ec5375e88e.zip | |
auto merge of #15995 : Ryman/rust/sync_spsc_peek, r=alexcrichton
The current spsc implementation doesn't enforce single-producer
single-consumer usage and also allows unsafe memory use through
peek & pop.
For safer usage, `new` now returns a pair of owned objects which
only allow consumer or producer behaviors through an `Arc`.
Through restricting the mutability of the receiver to `mut` the
peek and pop behavior becomes safe again, with the compiler
complaining about usage which could lead to problems.
To fix code broken from this, update:
Queue::new(x) -> unsafe { Queue::unchecked_new(x) }
[breaking-change]
For an example of broken behavior, check the added test which uses the unchecked constructor.
Diffstat (limited to 'src/libsyntax/parse')
0 files changed, 0 insertions, 0 deletions
