Re:Lock freedom without garbage collection in Rust
by aturon on Thursday August 27, 2015 @05:30PM
(#10132239)
Oh, it's also worth saying that only the `unlinked` method really has to be unsafe, since it's the root of any unsafety with this API. I chose to make the `_shared` methods unsafe as well because they present one of the ways that using `unlinked` could go wrong, but you could reduce the amount of unsafety to a single line in principle.
[ Parent
| on HN ]
Re:Lock freedom without garbage collection in Rust
by aturon on Thursday August 27, 2015 @05:43PM
(#10132319)
After discussing idioms with a few others on the Rust team, I've pushed this refactoring, bringing the example down to a single use of `unsafe`. Feels much cleaner, and draws attention to `unlinked` as the source of unsafety here.
Re:Lock freedom without garbage collection in Rust
by bjz_ on Thursday August 27, 2015 @05:49PM
(#10132360)
Here is the commit for the benefit of others: https://github.com/aturon/crossbeam/commit/cc57af9e63a04013f...