summaryrefslogtreecommitdiff
path: root/bootstraptest
diff options
context:
space:
mode:
authorKoichi Sasada <ko1@atdot.net>2020-12-12 06:54:46 +0900
committerKoichi Sasada <ko1@atdot.net>2020-12-12 08:36:52 +0900
commit70a311fdeb66ce80b562ccc4459c409cea64b74c (patch)
tree759740cde8a1b1b86505b119af8b585325459974 /bootstraptest
parent124321e0c7ab8dac1ffce78c653cc677f878d5b0 (diff)
trap on non-main ractor
trap can accept blopck/Proc and it can violate Rator isolation, so the Proc should be isolatable when trap is used on non-main ractor.
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/3888
Diffstat (limited to 'bootstraptest')
-rw-r--r--bootstraptest/test_ractor.rb18
1 files changed, 18 insertions, 0 deletions
diff --git a/bootstraptest/test_ractor.rb b/bootstraptest/test_ractor.rb
index 81bea95e01..b13ecbe3e9 100644
--- a/bootstraptest/test_ractor.rb
+++ b/bootstraptest/test_ractor.rb
@@ -1133,6 +1133,24 @@ assert_equal '[true, false]', %q{
}.take
}
+# Can not trap with not isolated Proc on non-main ractor
+assert_equal '[:ok, :ok]', %q{
+ a = []
+ Ractor.new{
+ trap(:INT){p :ok}
+ }.take
+ a << :ok
+
+ begin
+ Ractor.new{
+ s = 'str'
+ trap(:INT){p s}
+ }.take
+ rescue => Ractor::RemoteError
+ a << :ok
+ end
+}
+
###
### Synchronization tests
###