diff options
| author | Kevin Butler <haqkrs@gmail.com> | 2014-07-25 20:58:27 +0100 |
|---|---|---|
| committer | Kevin Butler <haqkrs@gmail.com> | 2014-08-01 20:09:03 +0100 |
| commit | 7b817b6ab97f31d96dc935278fa4d34e4b510782 (patch) | |
| tree | cb6f23e65aa1564fdd92c2baa60e0e95a4e6ad8c /src/rustllvm/PassWrapper.cpp | |
| parent | 624885810344184f7040892637250c35ceaf8db7 (diff) | |
| download | rust-7b817b6ab97f31d96dc935278fa4d34e4b510782.tar.gz rust-7b817b6ab97f31d96dc935278fa4d34e4b510782.zip | |
libsync: Add safer abstraction for SPSC queue.
The current spsc implementation doesn't enforce single-producer
single-consumer usage and also allows unsafe memory use through
peek & pop.
For safer usage, `spsc_queue::queue` now returns a pair of owned objects which
only allow consumer or producer behaviours through an `Arc`.
Through restricting the mutability of the receiver to `mut` the
peek and pop behaviour 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::new(x) }
[breaking-change]
Diffstat (limited to 'src/rustllvm/PassWrapper.cpp')
0 files changed, 0 insertions, 0 deletions
