Skip to content

Commit 1216a86

Browse files
rm155hsbt
authored andcommitted
Change PerRactorSingleton to RactorLocalSingleton
1 parent ec4f66d commit 1216a86

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

lib/singleton.rb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -196,10 +196,10 @@ def included(klass)
196196
# Returns the singleton instance.
197197
end
198198

199-
module PerRactorSingleton
199+
module RactorLocalSingleton
200200
include Singleton::SingletonInstanceMethods
201201

202-
module PerRactorSingletonClassMethods
202+
module RactorLocalSingletonClassMethods
203203
include Singleton::SingletonClassMethods
204204
def instance
205205
set_mutex(Thread::Mutex.new) if Ractor.current[mutex_key].nil?
@@ -214,11 +214,11 @@ def instance
214214
private
215215

216216
def instance_key
217-
:"__PerRactorSingleton_instance_with_class_id_#{object_id}__"
217+
:"__RactorLocalSingleton_instance_with_class_id_#{object_id}__"
218218
end
219219

220220
def mutex_key
221-
:"__PerRactorSingleton_mutex_with_class_id_#{object_id}__"
221+
:"__RactorLocalSingleton_mutex_with_class_id_#{object_id}__"
222222
end
223223

224224
def set_instance(val)
@@ -231,7 +231,7 @@ def set_mutex(val)
231231
end
232232

233233
def self.module_with_class_methods
234-
PerRactorSingletonClassMethods
234+
RactorLocalSingletonClassMethods
235235
end
236236

237237
extend Singleton::SingletonClassProperties

0 commit comments

Comments
 (0)