/* Terminate execution of a thread and remove it from Active Threads.  */
osStatus osThreadTerminate(osThreadId thread_id)
/* Terminate execution of a thread and remove it from Active Threads.  */
osStatus osThreadTerminate(osThreadId thread_id)
{
		if (thread->event_group != NULL) {
			vEventGroupDelete(thread->event_group);
		}
		vTaskDelete(thread->handle);
		thread->handle = NULL;
		return osOK;
	} else {
		return osErrorParameter;
	}
}