=begin
= R35480 ExtendedMemo

This memo is extended version of r35480.

main-thread sub-thread timer thread


waiting at gvl_yield:112 (cond_wait)
wait at gvl_yield:133 (native_mutex_unlock)
gvl_acquire_common
rb_wakeup_timer_thread
activated
set timer interrupt to the main thread
sleep(100ms)
wait at gvl_acquire_common:64 (cond_wait)
sub thread as the current thread
run Ruby thread
...100ms (time quantum)
set timer interrupt to the sub thread
sleep(unlimited)
rb_threadptr_execute_interrupts_common
rb_thread_schedule_limits
gvl_release_common
wait at gvl_yield:121 (native_cond_wait)
back to gvl_yield
return to rb_thread_schedule_limits
set main thread as the current thread
gvl_yield
wait at gvl_yield:112 (cond_wait)

The problem is starvation of main thread.

See:
(1) yield by main thread
(2) timer thread set timer interrupt flag of main thread
(3) run sub thread
(4) switch from sub thread
(5) switch to main thread
(6) main thread settled timer thread, then goto (1)

To solve this issue, we add a yielding flag to prohibit setting timer interrupt flag of yielding thread.

=end