Bläddra i källkod

No need to lock the header again

Cédric Augonnet 14 år sedan
förälder
incheckning
1b0a67230d
1 ändrade filer med 2 tillägg och 5 borttagningar
  1. 2 5
      src/datawizard/reduction.c

+ 2 - 5
src/datawizard/reduction.c

@@ -73,21 +73,18 @@ void _starpu_redux_init_data_replicate(starpu_data_handle handle, struct starpu_
 	replicate->initialized = 1;
 }
 
-/* Enable reduction mode */
+/* Enable reduction mode. This function must be called with the header lock
+ * taken. */
 void starpu_data_start_reduction_mode(starpu_data_handle handle)
 {
 	unsigned worker;
 
-	_starpu_spin_lock(&handle->header_lock);
-
 	for (worker = 0; worker < STARPU_NMAXWORKERS; worker++)
 	{
 		struct starpu_data_replicate_s *replicate;
 		replicate = &handle->per_worker[worker];
 		replicate->initialized = 0;
 	}
-
-	_starpu_spin_unlock(&handle->header_lock);
 }
 
 /* Force reduction */