thread-safety of newton-cotes integration