summaryrefslogtreecommitdiff
path: root/bootstraptest
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2021-03-07 00:58:28 +0900
committerGitHub <noreply@github.com>2021-03-07 00:58:28 +0900
commitb3c53a8a885be8f5cc2b712798b0d2741c488ce4 (patch)
tree4d0b0fad023a3867e1b8da884779cca6b57ed5b1 /bootstraptest
parent8ccc12118ea5257f846476088eb9c64944560892 (diff)
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.
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/4241 Merged-By: nobu <nobu@ruby-lang.org>
Diffstat (limited to 'bootstraptest')
-rw-r--r--bootstraptest/test_ractor.rb12
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