Preview Ruby 4.1 is a preview. It can change before the final release. Switch to Ruby 4.0 →
class method · added in Ruby 3.4
Ractor.main?
() -> ::boolish
main?
ractor.rb
View on GitHub ↗
# File tmp/rubies/ruby-4.1.0-preview1/ractor.rb, line 547
def self.main?
Primitive.attr! :leaf
__builtin_cexpr! %q{
RBOOL(GET_VM()->ractor.main_ractor == rb_ec_ractor_ptr(ec))
}
end
Returns true if the current ractor is the main ractor.
Ruby version changes
-
3.4
-
Ractor.main?is added. [Feature #20627]
-