instance method blocked_by?

Ruby on Rails 8.0.4

Since v5.2.8.1 Private

Available in: v5.2.8.1 v6.0.6 v6.1.7.10 v7.0.10 v7.1.6 v7.2.3 v8.0.4 v8.1.2

Signature

blocked_by?(victim, blocker, all_threads)

No documentation comment.

Parameters

victim req
blocker req
all_threads req
Source
# File actionpack/lib/action_dispatch/middleware/debug_locks.rb, line 108
      def blocked_by?(victim, blocker, all_threads)
        return false if victim.equal?(blocker)

        case victim[:sleeper]
        when :start_sharing
          blocker[:exclusive] ||
            (!victim[:waiting] && blocker[:compatible] && !blocker[:compatible].include?(false))
        when :start_exclusive
          blocker[:sharing] > 0 ||
            blocker[:exclusive] ||
            (blocker[:compatible] && !blocker[:compatible].include?(victim[:purpose]))
        when :yield_shares
          blocker[:exclusive]
        when :stop_exclusive
          blocker[:exclusive] ||
            victim[:compatible] &&
            victim[:compatible].include?(blocker[:purpose]) &&
            all_threads.all? { |other| !other[:compatible] || blocker.equal?(other) || other[:compatible].include?(blocker[:purpose]) }
        end
      end

Defined in actionpack/lib/action_dispatch/middleware/debug_locks.rb line 108 · View on GitHub · Improve this page · Find usages on GitHub

Defined in ActionDispatch::DebugLocks

Type at least 2 characters to search.

↑↓ navigate · open · esc close