Terminate list is supposed to be a double linked list. At least osRtxThreadListUnlink() expects one.
@@ -1176,6 +1176,7 @@ void svcRtxThreadExit (void) {
// Update Thread State and put it into Terminate Thread list
thread->state = osRtxThreadTerminated;
thread->thread_prev = NULL;
+ osRtxInfo.thread.terminate_list->thread_prev = thread;
thread->thread_next = osRtxInfo.thread.terminate_list;
osRtxInfo.thread.terminate_list = thread;
}
@@ -1241,6 +1242,7 @@ osStatus_t svcRtxThreadTerminate (osThreadId_t thread_id) {
// Update Thread State and put it into Terminate Thread list
thread->state = osRtxThreadTerminated;
thread->thread_prev = NULL;
+ osRtxInfo.thread.terminate_list->thread_prev = thread;
thread->thread_next = osRtxInfo.thread.terminate_list;
osRtxInfo.thread.terminate_list = thread;
}
