Project

General

Profile

Bug #5229

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

Added by normalperson (Eric Wong) almost 7 years ago. Updated almost 7 years ago.

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

Description

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

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

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


Related issues

Related to Ruby trunk - Bug #5251: Thread Change Breaks Windows BuildsClosed2011-08-30

Associated revisions

Revision 0cebfad2
Added by kosaki (Motohiro KOSAKI) almost 7 years ago

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

  • test/-ext-/old_thread_select/test_old_thread_select.rb:
    a testcase for rb_thread_select().

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

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

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

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33117 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

Revision 33117
Added by kosaki (Motohiro KOSAKI) almost 7 years ago

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

  • test/-ext-/old_thread_select/test_old_thread_select.rb:
    a testcase for rb_thread_select().

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

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

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

Revision 33117
Added by kosaki (Motohiro KOSAKI) almost 7 years ago

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

  • test/-ext-/old_thread_select/test_old_thread_select.rb:
    a testcase for rb_thread_select().

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

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

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

Revision 33117
Added by kosaki (Motohiro KOSAKI) almost 7 years ago

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

  • test/-ext-/old_thread_select/test_old_thread_select.rb:
    a testcase for rb_thread_select().

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

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

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

Revision 33117
Added by kosaki (Motohiro KOSAKI) almost 7 years ago

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

  • test/-ext-/old_thread_select/test_old_thread_select.rb:
    a testcase for rb_thread_select().

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

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

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

Revision 33117
Added by kosaki (Motohiro KOSAKI) almost 7 years ago

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

  • test/-ext-/old_thread_select/test_old_thread_select.rb:
    a testcase for rb_thread_select().

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

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

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

Revision 4e9438bc
Added by kosaki (Motohiro KOSAKI) almost 7 years ago

  • backport r33117 from trunk.

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

  • test/-ext-/old_thread_select/test_old_thread_select.rb:
    a testcase for rb_thread_select().

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

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

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

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@33119 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

Revision ee7d5236
Added by usa (Usaku NAKAMURA) almost 7 years ago

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

  • thread.c (rb_thread_select): must call rb_fd_init() before using
    rb_fdset_t. see the implementations of rb_fd_init()s if you want to
    know the reason.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33128 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

Revision 33128
Added by usa (Usaku NAKAMURA) almost 7 years ago

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

  • thread.c (rb_thread_select): must call rb_fd_init() before using
    rb_fdset_t. see the implementations of rb_fd_init()s if you want to
    know the reason.

Revision 33128
Added by usa (Usaku NAKAMURA) almost 7 years ago

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

  • thread.c (rb_thread_select): must call rb_fd_init() before using
    rb_fdset_t. see the implementations of rb_fd_init()s if you want to
    know the reason.

Revision 33128
Added by usa (Usaku NAKAMURA) almost 7 years ago

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

  • thread.c (rb_thread_select): must call rb_fd_init() before using
    rb_fdset_t. see the implementations of rb_fd_init()s if you want to
    know the reason.

Revision 33128
Added by usa (Usaku NAKAMURA) almost 7 years ago

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

  • thread.c (rb_thread_select): must call rb_fd_init() before using
    rb_fdset_t. see the implementations of rb_fd_init()s if you want to
    know the reason.

Revision 33128
Added by usa (Usaku NAKAMURA) almost 7 years ago

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

  • thread.c (rb_thread_select): must call rb_fd_init() before using
    rb_fdset_t. see the implementations of rb_fd_init()s if you want to
    know the reason.

Revision b1ab5d1b
Added by kosaki (Motohiro KOSAKI) almost 7 years ago

merge revision(s) 33128:

* win32/win32.c, include/ruby/intern.h (rb_w32_fd_copy): implement
  for rb_thread_select() in thread.c.  the use of rb_fd_copy() is
  introduced in r33117.
  [Bug #5229] 

* thread.c (rb_thread_select): must call rb_fd_init() before using
  rb_fdset_t.  see the implementations of rb_fd_init()s if you want to
  know the reason.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@33134 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

History

#1 [ruby-core:39103] Updated by ko1 (Koichi Sasada) almost 7 years ago

  • Assignee set to kosaki (Motohiro KOSAKI)

#2 Updated by kosaki (Motohiro KOSAKI) almost 7 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 (rb_thread_select): rewrite by using
    rb_thread_fd_select(). old one is EINTR unsafe.
    Patch by Eric Wong. [Bug #5229]

  • test/-ext-/old_thread_select/test_old_thread_select.rb:
    a testcase for rb_thread_select().

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

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

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

Also available in: Atom PDF