summaryrefslogtreecommitdiff
path: root/ractor.rb
diff options
context:
space:
mode:
authorMarc-Andre Lafortune <github@marc-andre.ca>2020-12-05 00:04:48 -0500
committerMarc-André Lafortune <github@marc-andre.ca>2020-12-07 02:21:12 -0500
commit53ce71b5af09843e1f6dfac7d2f39fa4cf682b12 (patch)
tree17b4802b9fd14507f1221fc6ee37aa2df8bbdb5d /ractor.rb
parentc2fa024e0220aca6e2437e56df2abf1a2368cbdf (diff)
Ractor.select requires an argument or yield_value
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/3848
Diffstat (limited to 'ractor.rb')
-rw-r--r--ractor.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/ractor.rb b/ractor.rb
index 89e39e5e1c..ca09aee7be 100644
--- a/ractor.rb
+++ b/ractor.rb
@@ -71,6 +71,8 @@ class Ractor
# # and r is :yield
#
def self.select(*ractors, yield_value: yield_unspecified = true, move: false)
+ raise ArgumentError, 'specify at least one ractor or `yield_value`' if yield_unspecified && ractors.empty?
+
__builtin_cstmt! %q{
const VALUE *rs = RARRAY_CONST_PTR_TRANSIENT(ractors);
VALUE rv;