class ActiveSupport::Concurrency::ShareLock

def busy_for_exclusive?(purpose)

Must be called within synchronize
def busy_for_exclusive?(purpose)
  busy_for_sharing?(purpose) ||
    @sharing.size > (@sharing[Thread.current] > 0 ? 1 : 0)
end