You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Thread#kill behind Thread#raise: no tests for the delivered-and-rescued, retracted and fiber-wait paths #143
#127 queues a Thread#kill that arrives behind a parked Thread#raise and promotes it once the raise is dealt with (_killsBehindRaise in Src/Ruby/Runtime/RubyUtils.cs). Thread_KillBehindRaise1 covers only one of the ways that happens. In each of its parts, a Thread.handle_interrupt(RuntimeError => :never) mask holds the raise back, and the kill is promoted at the next safe point inside the mask (CheckAsyncException, then PromoteKillBehindRaise).
The raise is delivered and the thread rescues it. The kill then has to be parked and end the thread (UnparkLocked from GetPendingAsyncException).
The raise is withdrawn (RetractAsyncException). The waiting kill has to be parked then.
A fiber waiting for control (the killOnly promotion in the fiber-switch wait).
The hard part is determinism: the raise and the kill must both be parked before the thread reaches a safe point, and the raise must then be delivered unmasked. Options: a test-only hook in the runtime that holds a thread at a known point, or a C# test in IronRuby.Tests that parks both exceptions directly through RubyUtils before releasing the thread.
Activity