[ruby-cvs:71174] normal:r64083 (trunk): thread.c (blocking_region_end): clear ubf before unregister_ubf_list

normal at ruby-lang.org normal at ruby-lang.org
Sat Jul 28 12:10:10 JST 2018


normal	2018-07-28 12:10:10 +0900 (Sat, 28 Jul 2018)

  New Revision: 64083

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=64083

  Log:
    thread.c (blocking_region_end): clear ubf before unregister_ubf_list
    
    If we keep ubf set after unregistering, there is a window for
    other threads (including timer thread) to put this thread back
    on the ubf_list right away.  Entering ubf_list unexpectedly
    after GVL acquisition may cause spurious wakeup and trigger
    unexpected behavior.
    
    Finally, clear ubf before acquiring GVL, to since ubf is useless
    during GVL acquisition anyways and we don't want to waste cycles
    in other threads calling ubf for useless work.
    
    [ruby-core:88141] [Bug #14945]

  Modified files:
    trunk/thread.c


More information about the ruby-cvs mailing list