diff --git a/tests/kernel/threads/dynamic_thread/src/main.c b/tests/kernel/threads/dynamic_thread/src/main.c index 8c5863e477f..20f60f884d5 100644 --- a/tests/kernel/threads/dynamic_thread/src/main.c +++ b/tests/kernel/threads/dynamic_thread/src/main.c @@ -50,11 +50,13 @@ static void create_dynamic_thread(void) tid = k_thread_create(dyn_thread, dyn_thread_stack, STACKSIZE, dyn_thread_entry, NULL, NULL, NULL, - K_PRIO_PREEMPT(0), K_USER, K_NO_WAIT); + K_PRIO_PREEMPT(0), K_USER, K_FOREVER); k_object_access_grant(&start_sem, tid); k_object_access_grant(&end_sem, tid); + k_thread_start(tid); + k_sem_give(&start_sem); zassert_true(k_sem_take(&end_sem, K_SECONDS(1)) == 0, @@ -76,10 +78,12 @@ static void permission_test(void) tid = k_thread_create(dyn_thread, dyn_thread_stack, STACKSIZE, dyn_thread_entry, NULL, NULL, NULL, - K_PRIO_PREEMPT(0), K_USER, K_NO_WAIT); + K_PRIO_PREEMPT(0), K_USER, K_FOREVER); k_object_access_grant(&start_sem, tid); + k_thread_start(tid); + /* * Notice dyn_thread will not have permission to access * end_sem, which will cause kernel oops.