MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / receiver_timeout

Function receiver_timeout

components/lwp/lwp_ipc.c:778–803  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

776}
777
778static 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.

Callers

nothing calls this directly

Calls 7

rt_list_removeFunction · 0.85
rt_sched_lockFunction · 0.50
rt_spin_lockFunction · 0.50
rt_sched_insert_threadFunction · 0.50
rt_spin_unlockFunction · 0.50

Tested by

no test coverage detected