Explorar o código

Do not try to take sample lock if there is no listener anyway

Samuel Thibault %!s(int64=5) %!d(string=hai) anos
pai
achega
2fbf9def37
Modificáronse 1 ficheiros con 3 adicións e 0 borrados
  1. 3 0
      src/common/knobs.c

+ 3 - 0
src/common/knobs.c

@@ -462,6 +462,9 @@ void _starpu_perf_counter_register_updater(enum starpu_perf_counter_scope scope,
 
 static void update_sample(struct starpu_perf_counter_sample *sample, void *context)
 {
+	if (sample->listener == NULL)
+		return;
+
 	_starpu_spin_lock(&sample->lock);
 	struct perf_counter_array *counters = _get_counters(sample->scope);