lib/universa/service.rb in universa-3.13.2.1 vs lib/universa/service.rb in universa-3.13.2.2
- old
+ new
@@ -64,14 +64,22 @@
# Calling it when UMI is already constructed raises Error.
def configure &block
instance.configure &block
end
+
# Get the global UMI interface, creating it if need.
# @return [UMI] ready interface
def umi
- instance.umi
+ @@instance_lock.synchronize {
+ instance.umi
+ }
end
+
+ private
+
+ @@instance_lock = Monitor.new
+
end
# Register a class that will work as a proxy for UMI remote class. Such adapter class mist extend RemoteAdapter
# class. Once the class is registered, serive will automatically instantiate it when UMI will pass the instance
# of the corresponding remote class.