class ActiveRecord::AsynchronousQueriesTracker::Session
:nodoc:
:nodoc:
def active?
def active? @active.true? end
def finalize(wait = false)
def finalize(wait = false) @active.make_false if wait # Wait until all thread with a read lock are done @lock.with_write_lock { } end end
def initialize
:nodoc:
def initialize @active = Concurrent::AtomicBoolean.new(true) @lock = Concurrent::ReadWriteLock.new end
def synchronize(&block)
def synchronize(&block) @lock.with_read_lock(&block) end