Explorar el Código

nsuccs does not need to be atomically accessed any more, as it is protected by the cg spinlock

Samuel Thibault hace 13 años
padre
commit
bdf63e483b
Se han modificado 1 ficheros con 1 adiciones y 2 borrados
  1. 1 2
      src/core/dependencies/cg.c

+ 1 - 2
src/core/dependencies/cg.c

@@ -71,7 +71,7 @@ int _starpu_add_successor_to_cg_list(struct _starpu_cg_list *successors, struct
 	ret = successors->terminated;
 
 	/* where should that cg should be put in the array ? */
-	unsigned index = STARPU_ATOMIC_ADD(&successors->nsuccs, 1) - 1;
+	unsigned index = successors->nsuccs++;
 
 #ifdef STARPU_DYNAMIC_DEPS_SIZE
 	if (index >= successors->succ_list_size)
@@ -82,7 +82,6 @@ int _starpu_add_successor_to_cg_list(struct _starpu_cg_list *successors, struct
 		else
 			successors->succ_list_size = 4;
 
-		/* NB: this is thread safe as the tag->lock is taken */
 		successors->succ = (struct _starpu_cg **) realloc(successors->succ,
 			successors->succ_list_size*sizeof(struct _starpu_cg *));
 	}