class ActiveSupport::Concurrency::ShareLock

def busy_for_sharing?(purpose)

def busy_for_sharing?(purpose)
  (@exclusive_thread && @exclusive_thread != Thread.current) ||
    @waiting.any? { |t, (_, c)| t != Thread.current && !c.include?(purpose) }
end