pub type MeshWorkerCell<const N: usize> = AtomicCell<Option<MeshWorkerResponse<N>>>;
Expand description

NOTE: To test this cell for validity, we currently first use Arc::get_mut(), and then only if that succeeds do we call AtomicCell::take. This way, we avoid all atomic updates for the fast path read in the “not yet updated” case (though it would be faster without weak pointers); since once it’s updated, we switch from Pending to Done, this is only suboptimal for one frame.

Aliased Type§

struct MeshWorkerCell<const N: usize> {
    value: UnsafeCell<MaybeUninit<Option<MeshWorkerResponse<N>>>>,
}

Fields§

§value: UnsafeCell<MaybeUninit<Option<MeshWorkerResponse<N>>>>