MCPcopy Create free account
hub / github.com/NthTensor/Forte / drop

Method drop

src/scope.rs:957–969  ·  view source on GitHub ↗
(&mut self)

Source from the content-addressed store, hash-verified

955 // as a mutex. Just above, we executed
956 //
957 // state.swap(LOCKED, Ordering::Acquire)
958 //
959 // which transitions us from the `WOKEN` into the `LOCKED` state. Any
960 // concurrent caller that also tries to execute `poll` will fail this
961 // swap, and cause an abort. Exclusive access is therefore
962 // guaranteed.
963 //
964 // Exclusive access is not enough on its own: a previous poll's writes
965 // to the future must also be visible here, with no data race. There
966 // are two cases, by how this poll was scheduled:
967 //
968 // - Woken after returning `Pending`: the previous poll published its
969 // writes with the `Release` `compare_exchange(LOCKED, READY)` below.
970 // A `wake` reads `READY` and reschedules; its `swap(WOKEN, Relaxed)`
971 // is an RMW, so it stays within that `Release` store's release
972 // sequence. This `swap(LOCKED, Acquire)` reads `WOKEN` from it and

Callers

nothing calls this directly

Calls 1

remove_referenceMethod · 0.80

Tested by

no test coverage detected