Bläddra i källkod

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

Samuel Thibault 13 år sedan
förälder
incheckning
bdf63e483b
1 ändrade filer med 1 tillägg och 2 borttagningar
  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 *));
 	}