def _compare_and_set(old_value, new_value)
      return false unless @mutex.try_lock
      begin
        return false unless @value.equal? old_value
        @value = new_value
      ensure
        @mutex.unlock
      end
      true
    end
def _compare_and_set(old_value, new_value)
      return false unless @mutex.try_lock
      begin
        return false unless @value.equal? old_value
        @value = new_value
      ensure
        @mutex.unlock
      end
      true
    end
Atomically sets the value to the given updated value if the current value
 is equal the expected value.

 @param [Object] old_value
   The expected value.
 @param [Object] new_value
   The new value.

 @return [Boolean]
   `true` if successful, `false` indicates that the actual value was not
   equal to the expected value.