Skip to content
Commit e0ca403f authored by Andrew Boie's avatar Andrew Boie Committed by Anas Nashif
Browse files

kernel: add assert for mis-used k_thread_create()



k_thread_create() works as expected on both uninitialized memory,
or threads that have completely exited.

However, horrible and difficult to comprehend things can happen if a
thread object is already being used by the kernel and
k_thread_create() is called on it.

Historically this has been a problem with test cases trying to be
parsimonious with thread objects and not properly cleaning up
after themselves. Add an assertion for this which should catch
both the illegal creation of a thread already active, or threads
racing to create the same thread object.

Signed-off-by: default avatarAndrew Boie <andrew.p.boie@intel.com>
parent 9c9312c8
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment