nobu / ruby-lang.org wrote:
> vm_trace.c: defer interrupts while postponed jobs
> 
> * vm_trace.c (rb_postponed_job_flush): mask signal trap interrupt
>   too to defer handling after finalizers finished.
>   [ruby-core:66825] [Bug #10595]

Sorry, I tried something like this but it's not effective if the
finalizer has an expensive (or infinite) loop.

I suppose it's better than nothing and finalizers should not
be expensive...