Browse Source

Fix race condition in `_starpu_submit_job'.

Ludovic Courtès 13 years ago
parent
commit
72a9a540d1
1 changed files with 1 additions and 2 deletions
  1. 1 2
      src/core/task.c

+ 1 - 2
src/core/task.c

@@ -202,12 +202,11 @@ int _starpu_submit_job(struct _starpu_job *j)
 	/* notify bound computation of a new task */
 	/* notify bound computation of a new task */
 	_starpu_bound_record(j);
 	_starpu_bound_record(j);
 
 
-	j->terminated = 0;
-
 	_starpu_increment_nsubmitted_tasks();
 	_starpu_increment_nsubmitted_tasks();
 
 
 	_STARPU_PTHREAD_MUTEX_LOCK(&j->sync_mutex);
 	_STARPU_PTHREAD_MUTEX_LOCK(&j->sync_mutex);
 
 
+	j->terminated = 0;
 	j->submitted = 1;
 	j->submitted = 1;
 
 
 	int ret = _starpu_enforce_deps_and_schedule(j, 1);
 	int ret = _starpu_enforce_deps_and_schedule(j, 1);