Просмотр исходного кода

Do no liberate the job structure too early.

Cédric Augonnet лет назад: 16
Родитель
Сommit
f635a0a3db
1 измененных файлов с 1 добавлено и 2 удалено
  1. 1 2
      src/core/jobs.c

+ 1 - 2
src/core/jobs.c

@@ -81,8 +81,6 @@ void handle_job_termination(job_t j)
 	if (STARPU_UNLIKELY(j->terminated))
 		fprintf(stderr, "OOPS ... job %p was already terminated !!\n", j);
 
-	j->terminated = 1;
-
 	/* in case there are dependencies, wake up the proper tasks */
 	notify_dependencies(j);
 
@@ -106,6 +104,7 @@ void handle_job_termination(job_t j)
 		/* we do not desallocate the job structure if some is going to
 		 * wait after the task */
 		pthread_mutex_lock(&j->sync_mutex);
+		j->terminated = 1;
 		pthread_cond_broadcast(&j->sync_cond);
 		pthread_mutex_unlock(&j->sync_mutex);
 	}