Bug #5229

[PATCH] thread.c (rb_thread_select): implement using rb_thread_fd_select

Added by Eric Wong over 2 years ago. Updated over 2 years ago.

[ruby-core:39102]
Status:Closed
Priority:Normal
Assignee:Motohiro KOSAKI
Category:core
Target version:1.9.3
ruby -v:ruby 1.9.4dev (2011-08-25 trunk 33057) [x86_64-linux] Backport:

Description

rbthreadselect() is deprecated, but should provide graceful
handling of interrupts for compatibility. rbthreadfd_select()
provides graceful handling of interrupts and won't fail with
EINTR.

Added -ext- test case since no internal Ruby code paths uses
rbthreadselect() directly.

This is a regression from 1.9.2 and should be backported to 1.9.3, too

0001-thread.c-rb_thread_select-implement-using-rb_thread_.patch Magnifier (6.28 KB) Eric Wong, 08/25/2011 08:33 AM


Related issues

Related to ruby-trunk - Bug #5251: Thread Change Breaks Windows Builds Closed 08/30/2011

Associated revisions

Revision 33117
Added by Motohiro KOSAKI over 2 years ago

  • thread.c (rbthreadselect): rewrite by using
    rbthreadfd_select(). old one is EINTR unsafe.
    Patch by Eric Wong. [Bug #5229]

  • test/-ext-/oldthreadselect/testoldthreadselect.rb:
    a testcase for rb
    thread_select().

  • ext/-test-/oldthreadselect/oldthreadselect.c: ditto.

  • ext/-test-/oldthreadselect/depend: ditto.

  • ext/-test-/oldthreadselect/extconf.rb: ditto.

Revision 33128
Added by Usaku NAKAMURA over 2 years ago

  • win32/win32.c, include/ruby/intern.h (rbw32fdcopy): implement
    for rb
    threadselect() in thread.c. the use of rbfd_copy() is
    introduced in r33117.
    [Bug #5229]

  • thread.c (rbthreadselect): must call rbfdinit() before using
    rbfdsett. see the implementations of rbfdinit()s if you want to
    know the reason.

History

#1 Updated by Koichi Sasada over 2 years ago

  • Assignee set to Motohiro KOSAKI

#2 Updated by Motohiro KOSAKI over 2 years ago

  • Status changed from Open to Closed
  • % Done changed from 0 to 100

This issue was solved with changeset r33117.
Eric, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.


  • thread.c (rbthreadselect): rewrite by using
    rbthreadfd_select(). old one is EINTR unsafe.
    Patch by Eric Wong. [Bug #5229]

  • test/-ext-/oldthreadselect/testoldthreadselect.rb:
    a testcase for rb
    thread_select().

  • ext/-test-/oldthreadselect/oldthreadselect.c: ditto.

  • ext/-test-/oldthreadselect/depend: ditto.

  • ext/-test-/oldthreadselect/extconf.rb: ditto.

Also available in: Atom PDF