Actions
Bug #17344
closed`Ractor#shareable?` confused by recursive structures
Description
y = []; x = [y, {}].freeze; y << x; y.freeze
Ractor.shareable?(y) # => false, ok, the `{}` is not frozen
Ractor.shareable?(x) # => false, ok
Ractor.shareable?(y) # => true, not ok!
The error is that we can not mark anything as shareable until the whole tree has been searched successfully. Only when the full traversal is successful, then all visited objects can be marked as shareable. There might be a more clever way, but I couldn't think of one when working on my backport.
Actions
Like0
Like0Like0