/* Terminate execution of a thread and remove it from ActiveThreads.  */
osStatus svcThreadTerminate(osThreadId thread_id)
/* Terminate execution of a thread and remove it from ActiveThreads.  */
osStatus svcThreadTerminate(osThreadId thread_id)
{ 
    return osErrorParameter;
  }
  stk = ptcb->priv_stack ? ptcb->stack : NULL;
  res = rt_tsk_delete(ptcb->task_id);
  if (res == OS_R_NOK) {
    return osErrorResource;
  }
  if (stk != NULL) {                            
    rt_free_mem(os_stack_mem, stk);
  }
  return osOK;
}