diff options
author | NARUSE, Yui <naruse@airemix.jp> | 2021-03-13 05:12:54 +0900 |
---|---|---|
committer | NARUSE, Yui <naruse@airemix.jp> | 2021-03-13 05:12:54 +0900 |
commit | 6f9e007729d53fdbc22e37e52129ea5aa2556d0e (patch) | |
tree | 416fb1d9cd961cd9822e494e7709df557ee7d360 /bootstraptest | |
parent | 6bf32cbed8f3fd0b73b99737d671f833c594d800 (diff) |
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(-)
Diffstat (limited to 'bootstraptest')
-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 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 |