| 776 | } |
| 777 | |
| 778 | static void receiver_timeout(void *parameter) |
| 779 | { |
| 780 | struct rt_thread *thread = (struct rt_thread *)parameter; |
| 781 | rt_channel_t ch; |
| 782 | rt_sched_lock_level_t slvl; |
| 783 | |
| 784 | rt_sched_lock(&slvl); |
| 785 | |
| 786 | ch = (rt_channel_t)(thread->wakeup_handle.user_data); |
| 787 | |
| 788 | thread->error = -RT_ETIMEOUT; |
| 789 | thread->wakeup_handle.func = RT_NULL; |
| 790 | |
| 791 | rt_spin_lock(&ch->slock); |
| 792 | ch->stat = RT_IPC_STAT_IDLE; |
| 793 | |
| 794 | rt_list_remove(&RT_THREAD_LIST_NODE(thread)); |
| 795 | /* insert to schedule ready list */ |
| 796 | rt_sched_insert_thread(thread); |
| 797 | |
| 798 | _rt_channel_check_wq_wakup_locked(ch); |
| 799 | rt_spin_unlock(&ch->slock); |
| 800 | |
| 801 | /* do schedule */ |
| 802 | rt_sched_unlock_n_resched(slvl); |
| 803 | } |
| 804 | |
| 805 | /** |
| 806 | * Fetch a message from the specified IPC channel. |
nothing calls this directly
no test coverage detected