From 6f9e007729d53fdbc22e37e52129ea5aa2556d0e Mon Sep 17 00:00:00 2001 From: "NARUSE, Yui" Date: Sat, 13 Mar 2021 05:12:54 +0900 Subject: merge revision(s) b3c53a8a885be8f5cc2b712798b0d2741c488ce4: [Backport #17672] Make Ractor stdio belonging to the Ractor [Bug #17672] Defer making ractor stdio until ractor started. Before ractor started, created objects belong to the caller ractor instead of the created ractor. --- bootstraptest/test_ractor.rb | 12 ++++++++++++ ractor.c | 9 --------- thread.c | 9 +++++++++ 3 files changed, 21 insertions(+), 9 deletions(-) --- bootstraptest/test_ractor.rb | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'bootstraptest') diff --git a/bootstraptest/test_ractor.rb b/bootstraptest/test_ractor.rb index fd698fa4d7..cbf58383c7 100644 --- a/bootstraptest/test_ractor.rb +++ b/bootstraptest/test_ractor.rb @@ -780,6 +780,18 @@ assert_equal 'ok', %q{ 'ok' } +# $stdin,out,err belong to Ractor +assert_equal 'ok', %q{ + r = Ractor.new do + $stdin.itself + $stdout.itself + $stderr.itself + 'ok' + end + + r.take +} + # $DEBUG, $VERBOSE are Ractor local assert_equal 'true', %q{ $DEBUG = true -- cgit v1.2.3