[ruby/singleton] Only use RactorLocalSingleton if Ractor is defined

https://github.com/ruby/singleton/commit/f684d36a47
This commit is contained in:
rm155 2021-08-18 16:51:13 -04:00 committed by Hiroshi SHIBATA
parent a6e96df573
commit d0c1eef511
No known key found for this signature in database
GPG Key ID: F9CF13417264FAC2

View File

@ -196,6 +196,7 @@ module Singleton
# Returns the singleton instance.
end
if defined?(Ractor)
module RactorLocalSingleton
include Singleton::SingletonInstanceMethods
@ -236,3 +237,4 @@ module RactorLocalSingleton
extend Singleton::SingletonClassProperties
end
end