瀏覽代碼

No need to lock the header again

Cédric Augonnet 14 年之前
父節點
當前提交
1b0a67230d
共有 1 個文件被更改,包括 2 次插入5 次删除
  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 */