浏览代码

Callbacks are sometimes executed directly by the application threads.

Cédric Augonnet 15 年之前
父节点
当前提交
d10b14ab3c
共有 1 个文件被更改,包括 5 次插入2 次删除
  1. 5 2
      src/core/errorcheck.c

+ 5 - 2
src/core/errorcheck.c

@@ -20,9 +20,12 @@
 void set_local_worker_status(worker_status st)
 {
 	struct worker_s *worker = get_local_worker_key();
-	STARPU_ASSERT(worker);
 
-	worker->status = st;
+	/* It is possible that we call this function from the application (and
+	 * thereforce outside a worker), for instance if we are executing the
+	 * callback function of a task with a "NULL" codelet. */
+	if (worker)
+		worker->status = st;
 }
 
 worker_status get_local_worker_status(void)