class Rack::Session::Pool

def generate_sid(*args, use_mutex: true)

def generate_sid(*args, use_mutex: true)
  loop do
    sid = super(*args)
    break sid unless use_mutex ? @mutex.synchronize { @pool.key? sid.private_id } : @pool.key?(sid.private_id)
  end
end