/* Pass control to next thread that is in state READY.  */
static osStatus_t svcRtxThreadYield(void)
/* Pass control to next thread that is in state READY.  */
static osStatus_t svcRtxThreadYield(void)
{
    thread_running = osRtxThreadGetRunning();
    thread_ready   = osRtxInfo.thread.ready.thread_list;
    if ((thread_ready != NULL) &&
        (thread_ready->priority == thread_running->priority)) {
      osRtxThreadListRemove(thread_ready);
      osRtxThreadReadyPut(thread_running);
      EvrRtxThreadPreempted(thread_running);
      osRtxThreadSwitch(thread_ready);
    }
  }
  return osOK;
}