fix(rt-thread): Fixed a bug where the thread type (static/dynamic) was not distinguished when a thread was deleted, causing assertions to be triggered.

This commit is contained in:
MacRsh
2025-03-03 22:04:49 +08:00
parent 5b4ae2a4f3
commit ed754db9d9

View File

@@ -101,7 +101,11 @@ mr_err_t mr_port_thread_del(void *thread) {
rt_err_t ret;
/* Delete thread */
ret = rt_thread_delete(thread);
if (rt_object_is_systemobject((rt_object_t)thread) == RT_TRUE) {
ret = rt_thread_detach(thread);
} else {
ret = rt_thread_delete(thread);
}
/* Shift error code */
return err_shift(ret);