1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
//! Realtime-safe primitives.
//!
//! Everything in this module must be allocation-free and lock-free.
//! In particular, per `CLAUDE.md` § Prohibitions:
//!
//! - No `std::sync::Mutex`, `std::collections::HashMap`, `Vec::push`,
//! `Box::new`, or other allocator-touching operations may appear
//! in code reachable from the `IOProc` realtime callback.
//! - Errors are represented as `OSStatus`-style integers, never as
//! heap-allocated `String`s.
//!
//! The module is intentionally cross-platform: the realtime
//! invariants do not depend on any macOS-specific API, and being
//! able to unit-test them on any host is more valuable than gating
//! them behind `cfg(target_os = "macos")`.
//!
//! ## Public surface
//!
//! - [`RealtimeContext`] — a zero-sized compile-time witness that
//! the current call stack originates from the audio engine's
//! realtime thread.
//! - [`Refcount`] — a wait-free atomic reference counter for the
//! CFPlugIn `IUnknown` ref-counting contract.
//! - [`State`] / [`StateCell`] — the atomic AudioServerPlugin
//! lifecycle state machine (`Uninitialized → Initialized →
//! Running`).
//! - [`channel`] / [`Producer`] / [`Consumer`] — a lock-free SPSC
//! ring buffer.
//! - [`log`] — a bounded realtime log sink with an off-thread
//! drainer, built on the ring.
//!
//! ## Lint enforcement
//!
//! The realtime module re-enables the project's
//! `clippy::disallowed_types` and `clippy::disallowed_methods`
//! lints at `deny`. Those lists (`clippy.toml`) name the blocking
//! and kernel-traversing items that have no business in a realtime
//! path — `Mutex`, `Condvar`, `thread::sleep`, `File::open`, the
//! `std::sync::mpsc` channels, and so on — so the realtime
//! sub-tree cannot mention any of them even by accident. The lints
//! are `allow` everywhere else in the crate because non-realtime
//! code paths (initialisation, bundle generation, tests) use those
//! items legitimately.
pub use RealtimeContext;
pub use Refcount;
pub use ;
pub use ;