diff options
author | Koichi Sasada <ko1@atdot.net> | 2020-11-11 01:55:28 +0900 |
---|---|---|
committer | Koichi Sasada <ko1@atdot.net> | 2020-11-11 18:10:43 +0900 |
commit | deed21bb08170431891b65fda26f4a3557c9ffd4 (patch) | |
tree | 2ab4f0cdf1c273f39759b0177be14285da1aad8b /bootstraptest/test_ractor.rb | |
parent | db31ace934e8b900e90853bd875f23195837b398 (diff) |
ignore yield_atexit if outgoing port is closed
If outgoing_port is closed, Ractor.yield never successes.
[Bug #17310]
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/3755
Diffstat (limited to 'bootstraptest/test_ractor.rb')
-rw-r--r-- | bootstraptest/test_ractor.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/bootstraptest/test_ractor.rb b/bootstraptest/test_ractor.rb index 86a033cba8..0720c01caa 100644 --- a/bootstraptest/test_ractor.rb +++ b/bootstraptest/test_ractor.rb @@ -309,6 +309,16 @@ assert_equal 'ok', %q{ end } +# a ractor with closed outgoing port should terminate +assert_equal 'ok', %q{ + Ractor.new do + close_outgoing + end + + true until Ractor.count == 1 + :ok +} + # multiple Ractors can receive (wait) from one Ractor assert_equal '[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]', %q{ pipe = Ractor.new do |