Fix threads not waking up on SIGINT when using UBF_TIMER_PTHREAD
When using UBF_TIMER_PTHREAD, the timer_pthread_fn function will
not signal the main thread with SIGVTALRM in cases where
timer_pthread is armed before consume_communication_pipe is called.
This is because consume_communication_pipe will unarm the timer.
Fix this by checking the return value of consume_communication_pipe.
If it returns TRUE and the timer_pthread is disarmed, then signal
the main thread with SIGVTALRM.
This fixes TestThread#test_thread_timer_and_interrupt. It also
fixes the use of Ctrl+C/SIGINT in irb on OpenBSD, and I'm guessing
other platforms that use UBF_TIMER_PTHREAD. Previously,
you could hit Ctrl+C multiple times and it would do nothing until
another key was pressed (even Backspace).
If this is determined to be the correct fix, this should be
backported to 2.6, but it is not a problem in earlier versions.
Updated by jeremyevans0 (Jeremy Evans) 5 days ago
I've tested on Linux when forcing UBF_TIMER_PTHREAD. While the patch does not appear to be necessary on Linux, there are no regressions in the tests when using it, so it should be safe. It does fix the annoying current behavior on OpenBSD, so I hope a committer can review and commit it.