Acquire loading a particular value which was stored by a Release operation helps in establishing a happens-before relationship, but how exactly does this work? Does the fence create like a wait point, where it waits for all operations on the shared memory to finish after which we could finally drop the shared memory?
impl<T> Drop for Arc<T> {
fn drop(&mut self) {
if self.data().ref_count.fetch_sub(1, Release) == 1 {
fence(Acquire);
unsafe {
drop(Box::from_raw(self.ptr.as_ptr()));
}
}
}
}