Project

General

Profile

Actions

Bug #6575

closed

Thread#kill sets rb_errinfo() to Fixnum 8 after rb_protect(function, data, &error_tag)

Added by ibc (Iñaki Baz Castillo) almost 12 years ago. Updated over 11 years ago.

Status:
Rejected
Target version:
ruby -v:
ruby 1.9.3p0 (2011-10-30 revision 33570) [x86_64-linux]
Backport:
[ruby-core:45567]

Description

Using rb_protect() I've realized that when the thread is killed by other thread using Thread#kill, the error_tag passed to rb_protect() is set to 8 and rb_errinfo() returns Fixnum 8:

ret = rb_protect(function, data, &error_tag);

// While executing function() in Ruby land, our thread is
// killed by Thread.kill.

// If now I inspect rb_errinfo() it returns Fixnum 8, and
// error_tag it's set to integer 8.

Is it the expected behaviour? Wouldn't make more sense rb_errinfo() to return some kind of a new exception ThreadKilledException or whatever instead of Fixnum 8?


Related issues 1 (0 open1 closed)

Related to Ruby master - Bug #5993: Thread.new{ Fiber.new { Thread.exit }.resume }.join で例外Closednagachika (Tomoyuki Chikanaga)02/10/2012Actions
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0Like0