My solution:

class Random
  def initialize(n, seed = rand(2**32))
    @n = n
    @seed = @iseed = seed
  end
  def next
    Thread.critical = true
    srand(@seed)
    @seed = @seed ^ rand(2**32)
    val = rand(@n)
    Thread.critical = false
    return val
  end
  def reset
    @seed = @iseed
  end
end