/* Suspend the thread and chain it into the end of the list.  */
rt_inline rt_err_t rt_channel_list_suspend(rt_list_t *list, struct rt_thread *thread)
/* Suspend the thread and chain it into the end of the list.  */
rt_inline rt_err_t rt_channel_list_suspend(rt_list_t *list, struct rt_thread *thread)
{
    rt_err_t ret = rt_thread_suspend_with_flag(thread, RT_INTERRUPTIBLE);
    if (ret == RT_EOK)
    {
        rt_list_insert_before(list, &(thread->tlist));
    }
    return ret;
}