atomkernel: Support thread entry points running to completion. Ports which use a thread_shell() can allow the entry point to finish and return back to the thread_shell(), which sets the terminated flag and calls the scheduler to force another thread to be scheduled in. Currently implemented in the ARM and AVR ports.

This commit is contained in:
Kelvin Lawson
2016-05-23 20:50:51 +01:00
parent e99d05582f
commit b0afc266d1
4 changed files with 9 additions and 6 deletions

View File

@@ -97,7 +97,7 @@ static void thread_shell (void)
_reclaim_reent (&(curr_tcb->port_priv.reent));
/* Thread has run to completion: remove it from the ready list */
curr_tcb->suspended = TRUE;
curr_tcb->terminated = TRUE;
atomSched (FALSE);
}

View File

@@ -111,8 +111,9 @@ static void thread_shell (void)
curr_tcb->entry_point(curr_tcb->entry_param);
}
/* Not reached - threads should never return from the entry point */
/* Thread has run to completion: remove it from the ready list */
curr_tcb->terminated = TRUE;
atomSched (FALSE);
}