[ruby-cvs:71568] normal:r64476 (trunk): thread_sync.c (rb_mutex_sleep): disable interrupt checking in ensure

normal at ruby-lang.org normal at ruby-lang.org
Mon Aug 20 07:20:22 JST 2018


normal	2018-08-20 07:20:22 +0900 (Mon, 20 Aug 2018)

  New Revision: 64476

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

  Log:
    thread_sync.c (rb_mutex_sleep): disable interrupt checking in ensure
    
    This is needed to reliably fix ConditionVariable#wait on Thread#kill
    [Bug #14999] because there is still a chance an interrupt could fire
    and prevent lock acquisition after an ensure statement.
    
    Arguably, rb_mutex_lock itself should be uninterruptible, but that
    already prevents bootstraptest/test_thread.rb from completing and
    probably breaks existing use cases.
    
    For reference, POSIX expressly forbids EINTR from pthread_mutex_lock.
    
    [ruby-core:88556] [Bug #14999]

  Modified files:
    trunk/thread_sync.c


More information about the ruby-cvs mailing list