Skip to main content

Module thread_safety

Module thread_safety 

Source
Expand description

§Thread Safety Primitives

Based on “Formal methods for the unsafe side of the Force” (Antithesis, 2026). Provides rigorously defined primitives for bridging FFI and multi-threaded boundaries.

Structs§

MainThreadToken
A witness of execution that exists solely on a designated “Main Thread”.
SendWrapper
A wrapper that allows sending non-Send types across thread boundaries.

Functions§

designate_main_thread
Designate the calling thread as the application’s main thread.
main_thread_id
Returns the ThreadId previously designated as the main thread, if any.