mirror of
https://github.com/kelvinlawson/atomthreads.git
synced 2026-09-17 19:07:07 +02:00
ARM: Allow threads to run to completion.
This commit is contained in:
@@ -53,15 +53,11 @@ void
|
|||||||
test_thread (uint32_t param)
|
test_thread (uint32_t param)
|
||||||
{
|
{
|
||||||
uint32_t failures ;
|
uint32_t failures ;
|
||||||
CRITICAL_STORE ;
|
|
||||||
|
|
||||||
failures = test_start () ;
|
failures = test_start () ;
|
||||||
|
printf ("%s %s\r\n", ATOMTHREADS_TEST, failures ? "FAIL" : "PASS") ;
|
||||||
atomTimerDelay (10) ;
|
|
||||||
CRITICAL_START() ;
|
return;
|
||||||
printf ("%s %s\r\n", ATOMTHREADS_TEST, failures ? "FAIL" : "PASS") ;
|
|
||||||
exit (failures) ;
|
|
||||||
CRITICAL_END() ;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -61,8 +61,7 @@ thread_shell (void)
|
|||||||
* Enable interrupts - these will not be enabled when a thread
|
* Enable interrupts - these will not be enabled when a thread
|
||||||
* is first restored.
|
* is first restored.
|
||||||
*/
|
*/
|
||||||
// sei();
|
contextEnableInterrupts () ;
|
||||||
contextEnableInterrupts () ;
|
|
||||||
|
|
||||||
/* Call the thread entry point */
|
/* Call the thread entry point */
|
||||||
if (curr_tcb && curr_tcb->entry_point)
|
if (curr_tcb && curr_tcb->entry_point)
|
||||||
@@ -70,7 +69,10 @@ thread_shell (void)
|
|||||||
curr_tcb->entry_point(curr_tcb->entry_param);
|
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->suspended = TRUE;
|
||||||
|
atomSched (FALSE);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user