Przeglądaj źródła

fix atomicity of accessing a replicate mc

Samuel Thibault 7 lat temu
rodzic
commit
8714b5e2f0
1 zmienionych plików z 2 dodań i 0 usunięć
  1. 2 0
      src/datawizard/coherency.c

+ 2 - 0
src/datawizard/coherency.c

@@ -1131,8 +1131,10 @@ void _starpu_fetch_task_input_tail(struct starpu_task *task, struct _starpu_job
 		struct _starpu_data_replicate *local_replicate;
 
 		local_replicate = get_replicate(handle, mode, workerid, node);
+		_starpu_spin_lock(&handle->header_lock);
 		if (local_replicate->mc)
 			local_replicate->mc->diduse = 1;
+		_starpu_spin_unlock(&handle->header_lock);
 
 		_STARPU_TASK_SET_INTERFACE(task , local_replicate->data_interface, index);