Explorar o código

profiling: avoid intermixing taking sched_mutex and taking worker_info_mutex

This avoids helgrind reporting races about their respective order.
Samuel Thibault %!s(int64=4) %!d(string=hai) anos
pai
achega
fca36db0e9
Modificáronse 1 ficheiros con 3 adicións e 0 borrados
  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]);
 	}