/* This function is the timeout function for thread, normally which is invoked when thread is timeout to wait some resource. */
void rt_thread_timeout(void *parameter)
/* This function is the timeout function for thread, normally which is invoked when thread is timeout to wait some resource. */
void rt_thread_timeout(void *parameter)
{
    struct rt_thread *thread;
    thread = (struct rt_thread *)parameter;
    RT_ASSERT(thread != RT_NULL);
    RT_ASSERT(thread->stat == RT_THREAD_SUSPEND);
    thread->error = -RT_ETIMEOUT;
    rt_list_remove(&(thread->tlist));
    rt_schedule_insert_thread(thread);
    rt_schedule();
}