module TrackOpenInstances

def self.included(base)

Other tags:
    Api: - private

Returns:
  • (void) -

Parameters:
  • base (Class) -- The class including this module
def self.included(base)
  base.extend(ClassMethods)
  # @!attribute [rw] open_instances
  #   Internal storage for all tracked instances
  #   @return [Hash{Object => OpenInstance}] The list of currently tracked instances
  base.instance_variable_set(:@open_instances, {}.compare_by_identity)
  # @!visibility private
  # @!attribute [r] open_instances_mutex
  #   Mutex to ensure thread-safe access to the open_instances hash
  base.instance_variable_set(:@open_instances_mutex, Thread::Mutex.new)
end