Bug #251

$? is not thread scope

Added by Anonymous almost 7 years ago. Updated about 4 years ago.

[ruby-dev:35414]
Status:Closed
Priority:Low
Assignee:-
ruby -v: Backport:

Description

=begin
1.9 では $? がスレッドスコープでなくなっているようです。

以下のように、他のスレッドで動かしたコマンドの結果が $? に表
れます。

% ./ruby -ve '
t = Thread.new { system("false") }
p $?
t.join
p $?
'
ruby 1.9.0 (2008-07-09 revision 17977) [i686-linux]
false
#

1.8 では $? は変化しません。

% ruby-1.8 -ve '
t = Thread.new { system("false") }
p $?
t.join
p $?
'
ruby 1.8.7 (2008-07-10 revision 17572) [i686-linux]
nil
nil

あと、ついでにいうと、1.9 では $? の初期値が 1.8 と異なり
false です。
--
Tanaka Akira
=end

Associated revisions

Revision 39518
Added by Zachary Scott about 2 years ago

  • lib/ostruct.rb: Typo in OpenStruct overview [Github Fixes #251] Patch by Chun-wei Kuo

Revision 39518
Added by Zachary Scott about 2 years ago

  • lib/ostruct.rb: Typo in OpenStruct overview [Github Fixes #251] Patch by Chun-wei Kuo

History

#1 Updated by Anonymous almost 7 years ago

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

=begin
Applied in changeset r17981.
=end

Also available in: Atom PDF