Browse Source

Add missing unlock

Samuel Thibault 9 years ago
parent
commit
1c54fa0ccb
1 changed files with 5 additions and 2 deletions
  1. 5 2
      src/profiling/bound.c

+ 5 - 2
src/profiling/bound.c

@@ -864,17 +864,20 @@ void starpu_bound_print_mps(FILE *output)
 		return;
 		return;
 	}
 	}
 
 
-	STARPU_PTHREAD_MUTEX_LOCK(&mutex);
-
 	nw = starpu_worker_get_count();
 	nw = starpu_worker_get_count();
 	if (!nw)
 	if (!nw)
 		/* Make llvm happy about the VLA below */
 		/* Make llvm happy about the VLA below */
 		return;
 		return;
+
+	STARPU_PTHREAD_MUTEX_LOCK(&mutex);
 	nt = 0;
 	nt = 0;
 	for (tp = task_pools; tp; tp = tp->next)
 	for (tp = task_pools; tp; tp = tp->next)
 		nt++;
 		nt++;
 	if (!nt)
 	if (!nt)
+	{
+		STARPU_PTHREAD_MUTEX_UNLOCK(&mutex);
 		return;
 		return;
+	}
 
 
 	{
 	{
 		double times[nw*nt];
 		double times[nw*nt];