class Hamster::ReadCopyUpdateStack

def eql?(other)

def eql?(other)
  instance_of?(other.class) && @stack.eql?(other.instance_variable_get(:@stack))
end

def initialize

def initialize
  @stack = EmptyStack
  @lock = Mutex.new
end

def method_missing(name, *args, &block)

def method_missing(name, *args, &block)
  @stack.send(name, *args, &block)
end

def pop

def pop
  @lock.synchronize {
    top_value = @stack.peek
    @stack = @stack.pop
    top_value
  }
end

def push(value)

def push(value)
  @lock.synchronize { @stack = @stack.push(value) }
  self
end