Skip to content

Commit 776a139

Browse files
Support Platforms that don't define Ractor.make_shareable
by defining it as a no-op in those cases.
1 parent 2494bdc commit 776a139

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

harness/harness-common.rb

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,13 @@
1313
# Seed the global random number generator for repeatability between runs
1414
Random.srand(1337)
1515

16+
if !Ractor.respond_to?(:make_shareable)
17+
class Ractor
18+
#noop
19+
def make_shareable(obj, copy: false); obj; end
20+
end
21+
end
22+
1623
def format_number(num)
1724
num.to_s.split(".").tap do |a|
1825
# Insert comma separators but only in the whole number portion (a[0]).

0 commit comments

Comments
 (0)