Selaa lähdekoodia

Callbacks are sometimes executed directly by the application threads.

Cédric Augonnet 15 vuotta sitten
vanhempi
commit
d10b14ab3c
1 muutettua tiedostoa jossa 5 lisäystä ja 2 poistoa
  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)