Ordered thread-finish and join-wakeup protocol #
This composes the source order in thread.rs::terminate_active_thread:
beginTerminateActive marks the thread terminated and removes its TLS entries;
the caller performs each TLS cleanup; this module then runs the selected
termination hook; only then are joiners unblocked one at a time, with each
callback executed in that joiner's active-thread context. Callback execution remains an external obligation.
- none : ThreadFinishHandler
- vectorClocks : ThreadFinishHandler
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- globalState (error : GlobalStateError) : ThreadFinishError
- globalStateRequired : ThreadFinishError
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- wakeJoiners (manager : ThreadManager) (terminated : ThreadId) (waiters : List ThreadId) : PostTlsFinish
- wakeJoinersWithClocks (global : GlobalState) (manager : ThreadManager) (terminated : ThreadId) (waiters : List ThreadId) : PostTlsFinish
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
The source's chosen termination handler runs only after
completeTlsCleanup has returned its continuation.
Equations
- One or more equations did not get rendered due to their size.
- Miri.Concurrency.afterTlsCleanup Miri.Concurrency.ThreadFinishHandler.vectorClocks continuation global = throw Miri.Concurrency.ThreadFinishError.globalStateRequired
Instances For
Execute the vector-clock termination hook against an explicitly supplied global state. The production state is not replaced by a fresh initial state.
Equations
- One or more equations did not get rendered due to their size.
Instances For
One wakeup iteration. Miri's unblock_thread invokes the callback
synchronously; Lean exposes the exact callback action and leaves its effects
to the interpreter.
- complete (manager : ThreadManager) : JoinWakeStep
- invokeCallback (manager : ThreadManager) (terminated : ThreadId) (unblock : UnblockCallbackObligation) (remaining : List ThreadId) : JoinWakeStep
- callbackFailed (managerAfterFailure : ThreadManager) (terminated : ThreadId) (unblock : UnblockCallbackObligation) (remaining : List ThreadId) : JoinWakeStep
Instances For
Equations
Equations
- One or more equations did not get rendered due to their size.
Instances For
Start ordered joiner wakeups after TLS and the selected termination hook have both completed.
Equations
- One or more equations did not get rendered due to their size.
- manager.beginJoinerWakeups terminated [] = pure (Miri.Concurrency.JoinWakeStep.complete manager)
Instances For
Continue after actually invoking one callback. On callback failure the source returns immediately, preserving the post-failure machine state and leaving later joiners blocked. On success the scheduler restores the previous active thread before issuing the next callback.
Equations
- One or more equations did not get rendered due to their size.