tests/mem_protect/stackprot: Need a delay under SMP
The "alternate thread" test would spawn a thread and then exit the test, but on SMP that other thread runs asynchronously and it was possible for the main thread to exit the test entirely before the test thread had a chance to run (and overflow its stack), leading to spurious test case failures. Obviously we can't exactly synchronize to an async crash, so put a short delay in after spawning the thread. Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
This commit is contained in:
parent
9e37e80a1d
commit
83d1ca06dc
1 changed files with 5 additions and 0 deletions
|
@ -126,6 +126,11 @@ void test_create_alt_thread(void)
|
|||
k_thread_create(&alt_thread_data, alt_thread_stack_area, STACKSIZE,
|
||||
(k_thread_entry_t)alternate_thread, NULL, NULL, NULL,
|
||||
K_PRIO_COOP(1), K_USER, K_NO_WAIT);
|
||||
|
||||
/* Note that this sleep is required on SMP platforms where
|
||||
* that thread will execute asynchronously!
|
||||
*/
|
||||
k_sleep(K_MSEC(100));
|
||||
}
|
||||
|
||||
void test_main(void)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue