File: //usr/share/ri/3.0.0/system/Ractor/make_shareable-c.ri
U:RDoc::AnyMethod[iI"make_shareable:ETI"Ractor::make_shareable;TT:publico:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"*Make +obj+ shareable between ractors.;To:RDoc::Markup::BlankLine o;
; [I"L+obj+ and all the objects it refers to will be frozen, unless they are ;TI"already shareable.;T@o;
; [I"TIf +copy+ keyword is +true+, the method will copy objects before freezing them ;TI"4This is safer option but it can take be slower.;T@o;
; [I"KNote that the specification and implementation of this method are not ;TI"-mature and may be changed in the future.;T@o:RDoc::Markup::Verbatim; [I"obj = ['test']
;TI"*Ractor.shareable?(obj) #=> false
;TI"-Ractor.make_shareable(obj) #=> ["test"]
;TI")Ractor.shareable?(obj) #=> true
;TI")obj.frozen? #=> true
;TI")obj[0].frozen? #=> true
;TI"
;TI""# Copy vs non-copy versions:
;TI"obj1 = ['test']
;TI")obj1s = Ractor.make_shareable(obj1)
;TI"2obj1.frozen? #=> true
;TI"2obj1s.object_id == obj1.object_id #=> true
;TI"obj2 = ['test']
;TI"5obj2s = Ractor.make_shareable(obj2, copy: true)
;TI"3obj2.frozen? #=> false
;TI"2obj2s.frozen? #=> true
;TI"3obj2s.object_id == obj2.object_id #=> false
;TI"7obj2s[0].object_id == obj2[0].object_id #=> false
;T:@format0o;
; [I"WSee also the "Shareable and unshareable objects" section in the Ractor class docs.;T:
@fileI"ractor.rb;T:0@omit_headings_from_table_of_contents_below0I">Ractor.make_shareable(obj, copy: false) -> shareable_obj
;T0[ I"(obj, copy: false);T@2FI"Ractor;TcRDoc::NormalClass00