Applied in changeset commit:git|f8485f7d2615ea3429e4c8c234d15b5ded51120d. ---------- Ractor: make freeze and set_temporary_name owner-only Requested by matz on [Feature #22226]: a non-owner freezing somebody else's class is a hole, bec...ko1 (Koichi Sasada)
Only the Ractor which created a class/module may modify it: define, remove or undefine methods, alias, include/prepend, refine, define or remove constants, register an autoload, and set the class's own instance variables. Reading is unc...ko1 (Koichi Sasada)
A class variable is shared across the inheritance chain and the class it is stored in can migrate (cvar_overtaken), so the deciding Ractor is the owner of the class the variable is actually stored in, not of the receiver it was looked up...ko1 (Koichi Sasada)
Module#initialize_copy (Class#dup etc.) of a class/module created by another Ractor makes a copy owned by the copying Ractor. Since an owner may read the unshareable constant and instance variable values of its own classes, a raw table ...ko1 (Koichi Sasada)
Requested by matz on [Feature #22226]: a non-owner freezing somebody else's class is a hole, because it lets a third party make a class permanently unmodifiable. Naming is the same kind of change to the class itself. Module#freeze chec...ko1 (Koichi Sasada)
set_method_visibility only called rb_check_frozen, so public/private/protected and module_function never met the ownership check, even though the proposal lists visibility changes as owner-only. A non-owner Ractor could rewrite the meth...ko1 (Koichi Sasada)
A singleton class belongs to the owner of the object it is attached to, and Ractor#send(move: true) hands that object over. Without this the receiver could define singleton methods on a moved object only when its singleton class had not...ko1 (Koichi Sasada)
Document the model: only the creator Ractor can modify a class/module, singleton class ownership follows the attached object, classes of a terminated Ractor become read-only, and the main-Ractor-only rules for class instance variables, c...ko1 (Koichi Sasada)