Update rc decrement snipped

The atomic decrement to `rc` should be performed with an ordering of `Ordering::Release` rather than `ordering::Relaxed` to interact correctly with the fence. The code in the full `Drop` implementation at the bottom of the section is correct/
pull/316/head
Andrew Meredith 4 years ago committed by GitHub
parent 2747c4bb2c
commit 907001bdd0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -27,7 +27,7 @@ the last reference to the data).
<!-- ignore: simplified code -->
```rust,ignore
if inner.rc.fetch_sub(1, Ordering::Relaxed) != 1 {
if inner.rc.fetch_sub(1, Ordering::Release) != 1 {
return;
}
```

Loading…
Cancel
Save