mid-platform
No-std-safe replacements for the pieces of std::sync/std::cell mid-engine
actually needs, std-backed on native targets and hand-rolled (spin-based,
no OS to ask for a real wait) wherever std is off. Zero external
dependencies — every fallback in this crate is a from-scratch port of a real,
proven algorithm rather than a spin dependency, so mid-engine's real target
matrix (native desktop, wasm32-unknown-unknown) gets the behavior without
the crate.
Modules:
cell—SyncCell,SyncUnsafeCellsync::atomic— plain re-export ofcore::sync::atomicsync::Mutex—MutexGuardsync::RwLock—RwLockReadGuard,RwLockWriteGuardsync::Once/OnceLock—OnceStatesync::LazyLocksync::Barrier—BarrierWaitResultsync::Arc/Weak— plain re-export ofalloc::synchash—FxHasher,FoldedFxHasher,FixedHasher,fixed_hash_onecollections—HashMap,HashSet,OpenHashMap,OpenHashSet
Status: Phases 1, 2 and 3 done (see docs/mid-platform.md): the locks and
cells, the fast hasher, and HashMap/HashSet. C FFI: Once and Barrier are callable from C today (see their
own module pages); Mutex/RwLock/OnceLock/LazyLock are open work —
see docs/mid-platform.md, "Fixes and Problems."