<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def add(self, metric_producer):
 """Add a metric producer. :type metric_producer: :class: 'MetricProducer' :param metric_producer: The metric producer to add. """

        if metric_producer is None:
            raise ValueError
        with self.mp_lock:
            self.metric_producers.add(metric_producer)