瀏覽代碼

Check nowhere before releasing the sequential consistency

(which may unregister the handle and free its switch_cl, and thus task->cl here)
Samuel Thibault 5 年之前
父節點
當前提交
976f692c1c
共有 1 個文件被更改,包括 3 次插入1 次删除
  1. 3 1
      src/core/jobs.c

+ 3 - 1
src/core/jobs.c

@@ -344,6 +344,9 @@ void _starpu_handle_job_termination(struct _starpu_job *j)
 				_starpu_spin_unlock(&handle->header_lock);
 		}
 	}
+	/* Check nowhere before releasing the sequential consistency (which may
+	 * unregister the handle and free its switch_cl, and thus task->cl here.  */
+	unsigned nowhere = !task->cl || task->cl->where == STARPU_NOWHERE || task->where == STARPU_NOWHERE;
 	/* If this is a continuation, we do not release task dependencies now.
 	 * Task dependencies will be released only when the continued task
 	 * fully completes */
@@ -358,7 +361,6 @@ void _starpu_handle_job_termination(struct _starpu_job *j)
 	 * scheduler to process it : the task structure doesn't contain any valuable
 	 * data as it's not linked to an actual worker */
 	/* control task should not execute post_exec_hook */
-	unsigned nowhere = !task->cl || task->cl->where == STARPU_NOWHERE || task->where == STARPU_NOWHERE;
 	if(j->task_size == 1 && !nowhere && !j->internal
 #ifdef STARPU_OPENMP
 	/* If this is a continuation, we do not execute the post_exec_hook. The