Files
metal2vulkan/docs
Anees Iqbal aba4034dca Runtime: a program's exit handler reaches no destroyed thread-local
exit destroys the exiting thread's thread-locals before it runs the exit handlers (macOS, the
GNU C library), and LocalKey::with on a destroyed one panics, which in a handler aborts the
process. The exits lane case an_exit_handler_s_common_calls_answer_as_on_any_thread aborted
there on both: "cannot access a Thread Local Storage value during or after destruction" in
calls_at_exit on the M3, and on lavapipe at warm::pass::warming from PipelineMemo::compute,
in the handler's new_compute_pipeline_state.

Every runtime thread-local whose type needs dropping that a program's call reaches is now read
with try_with, with what the thread does once it can keep nothing:
- the making budget's turn (pipeline/budget.rs): program_turn takes none there, holds_turn is
  false, and a turn's give-back and lend read the note with try_with;
- the driver facts' expectation (driver_facts.rs): expecting runs the call alone, its messages
  relayed;
- the creation log's split (pipeline/creation_log.rs): none noted;
- the warm pass (warm/pass.rs): none;
- a relayed compile's held sink messages (device/compiles.rs): the call alone, its messages
  delivered as raised;
- a lowering's refusal (render/deferral.rs): lowering::refusing is false there, so a notice of
  a kind the device refuses while lowering is announced, as anywhere else;
- the debug-build checks of kept resident uses (binding.rs) and of slot rebinds (the
  translator's bind/graphics.rs): skipped.

dirty_pages, shards, resource_ids and contexts already read theirs with try_with; the rest hold
Copy values with no destructor. docs/API.md's accepted differences under "Process exit" say what
an exit handler's calls keep no state for.
2026-11-11 14:55:15 -08:00
..