src/task.c
/**
 * @brief  Executes end-of-life tasks
 *
 * @param  t    task to finalize
 * @param  val  value if the final yield
 * @param  ec   exit code
 */
@brief  Executes end-of-life tasks
@param  t    task to finalize
@param  val  value if the final yield
@param  ec   exit code
@brief Executes end - of - life tasks @param t task to finalize @param val value if the final yield @param ec exit code
static void
eol(struct xtask *t, union xvalue val, int ec)
{
	struct xmgr *mgr = t->mgr;
	struct xdefer *def = t->defer;
	t->defer = NULL;
	t->exitcode = ec;
	t->state = EXIT;
	while (def != NULL) {
		struct xdefer *next = def->next;
		def->fn(def->val);
		def->next = mgr->free_defer;
		mgr->free_defer = def;
		def = next;
		t->exitcode = ec & 0xFF;
		t->state = EXIT;
	}
	t->parent = NULL;
	t->value = val;
}
static void eol ( struct xtask * t , union xvalue val , int ec ) { struct xmgr * mgr = t -> mgr ; struct xdefer * def = t -> defer ; t -> defer = NULL ; t -> exitcode = ec ; t -> state = EXIT ; while ( def != NULL ) { struct xdefer * next = def -> next ; def -> fn ( def -> val ) ; def -> next = mgr -> free_defer ; mgr -> free_defer = def ; def = next ; t -> exitcode = ec & 0xFF ; t -> state = EXIT ; } t -> parent = NULL ; t -> value = val ; }
@brief  Executes end-of-life tasks
 @param  t    task to finalize
 @param  val  value if the final yield
 @param  ec   exit code
@brief Executes end - of - life tasks @param t task to finalize @param val value if the final yield @param ec exit code
// prevent task from being resumed explicity // mark exit status again in case defer resumed a separate task // disable the ability to yield