Преглед на файлове

profiling: avoid intermixing taking sched_mutex and taking worker_info_mutex

This avoids helgrind reporting races about their respective order.
Samuel Thibault преди 4 години
родител
ревизия
fca36db0e9
променени са 1 файла, в които са добавени 3 реда и са изтрити 0 реда
  1. 3 0
      src/profiling/profiling.c

+ 3 - 0
src/profiling/profiling.c

@@ -114,6 +114,9 @@ int starpu_profiling_status_set(int status)
 	{
 		struct _starpu_worker *worker_struct = _starpu_get_worker_struct(worker);
 		STARPU_PTHREAD_MUTEX_LOCK(&worker_struct->sched_mutex);
+	}
+	for (worker = 0; worker < starpu_worker_get_count(); worker++)
+	{
 		STARPU_PTHREAD_MUTEX_LOCK(&worker_info_mutex[worker]);
 	}