pub(crate) fn await_start(
py: Python<'_>,
slot: &Mutex<Option<JoinHandle<()>>>,
inner: &Inner,
spawned: ThreadId,
what: &str,
) -> PyResult<()>Expand description
Startup handshake shared by the capture and playback starts: with the GIL released,
waits up to ~2 s for the worker this call spawned (spawned) to publish RUNNING or
FAILED. A worker still STARTING when the window closes counts as started — its
retry ladder legitimately runs longer than this — and a failure after that is exposed
through state / last_error instead. On FAILED, join_failed_start tears down only
that thread (identity-checked, sparing a concurrent winner) and the worker’s recorded
error is raised as RuntimeError.