ultravisor/lib/ultravisor/child.rb in service_skeleton-1.0.5 vs ultravisor/lib/ultravisor/child.rb in service_skeleton-2.0.0
- old
+ new
@@ -183,17 +183,17 @@
end
!!(@restart == :always || (@restart == :on_failure && termination_exception))
end
- def unsafe_instance(wait: true)
+ def unsafe_instance
unless @access == :unsafe
raise Ultravisor::ThreadSafetyError,
"#unsafe_instance called on a child not declared with access: :unsafe"
end
- current_instance(wait: wait)
+ current_instance
end
def cast
unless castcall_enabled?
raise NoMethodError,
@@ -392,12 +392,12 @@
i.instance_variable_set(:@ultravisor_child_castcall_fd, r)
end
end
end
- def current_instance(wait: true)
+ def current_instance
@spawn_m.synchronize do
- while wait && @instance.nil?
+ while @instance.nil?
@spawn_cv.wait(@spawn_m)
end
return @instance
end