diff options
author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2021-03-07 00:58:28 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-07 00:58:28 +0900 |
commit | b3c53a8a885be8f5cc2b712798b0d2741c488ce4 (patch) | |
tree | 4d0b0fad023a3867e1b8da884779cca6b57ed5b1 /bootstraptest/test_ractor.rb | |
parent | 8ccc12118ea5257f846476088eb9c64944560892 (diff) | |
download | ruby-b3c53a8a885be8f5cc2b712798b0d2741c488ce4.tar.gz |
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.
Diffstat (limited to 'bootstraptest/test_ractor.rb')
-rw-r--r-- | bootstraptest/test_ractor.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/bootstraptest/test_ractor.rb b/bootstraptest/test_ractor.rb index 69f3337764..6299b50e3b 100644 --- a/bootstraptest/test_ractor.rb +++ b/bootstraptest/test_ractor.rb @@ -805,6 +805,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 |