mirror of
https://github.com/kelvinlawson/atomthreads.git
synced 2026-01-11 18:33:16 +01:00
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:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user