kithara-platform
Platform-aware runtime primitives for native and wasm32 targets. This crate is the portability boundary for synchronization, thread/task spawning, timing helpers, and conditional trait bounds used across the workspace.
Usage
use ;
let lock = new;
sleep.await;
Key types and entry points
Mutex<T>/RwLock<T>/Condvar— synchronization wrappers overparking_lot(native) orwasm_safe_thread(wasm32).MaybeSend/MaybeSync— conditional trait bounds (Send/Syncon native, blanket no-op on wasm32).thread::{spawn, spawn_named, is_main_thread, is_worker_thread, assert_main_thread, park_timeout, paced_backoff, unpark}— thread primitives with thread-affinity helpers.tokio::task::{spawn, spawn_blocking, yield_now}— runtime task primitives (nativetokio, worker-aware on wasm).time::{sleep, timeout, Instant, real_io, reset}— timing helpers; the single timestamp source (web_time/std::timeare banned outside this crate).CancelToken— the single workspace cancellation token;CancelScope,CancelGroup,CancelToken::{root, never, child}.flash— off-by-default, native, test-only cargo feature that swaps the wall clock for a deterministic virtual timeline.
Integration
Foundation crate used across the workspace (kithara-storage, kithara-assets, kithara-stream, kithara-play, kithara-ffi, and test infrastructure) to keep platform-specific branching isolated in one place.
See CONTEXT.md for detailed contracts, invariants, and internals.