Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Clear interrupt queue when acting on interrupt
If we don't clear the queue here and begin to act on a kill or raise event, we may poll again and find a different event that invalidate the one we're currently propagating. This led to intermittent failures on this spec: Thread#report_on_exception= when set to true prints the backtrace even if the thread was killed just after Thread#raise This spec tests that a raise event propagates all the way out even if a kill interrupts that process. It is difficult to simulate that without clearing the queue, since we poll for new interrupts many places that might be hit while raising (such as when printing out the report that an exception terminated the thread). The risk here is that an event will be lost, but it is unclear if it should be possible to queue multiple events that trigger stack unrolling.
- Loading branch information