Skip to main content

Module deferred_drop

Module deferred_drop 

Source
Expand description

Deferred drop handling.

We sometimes have Arc<dyn Participant>s we have obtained but don’t want to drop yet

See the top-level docs for context.

When we drop the Arc, the refcount might become zero. Then the inner type would be dropped. The inner type is allowed to call back into us (for example, it may drop an Account). We must therefore not drop a caller’s Participant with our own state lock held.

This module has a helper type for assuring that we do defer drops.

Structs§

GuardWithDeferredDrop 🔒
MutexGuard<State> but also a list of Arc<dyn Participant> to drop when we unlock

Type Aliases§

DeferredDrop 🔒
Participants we’ve acquired and which we want to drop later, convenience alias