Explorar o código

Callbacks are sometimes executed directly by the application threads.

Cédric Augonnet %!s(int64=15) %!d(string=hai) anos
pai
achega
d10b14ab3c
Modificáronse 1 ficheiros con 5 adicións e 2 borrados
  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)