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

Function _mutex_update_priority

src/ipc.c:828–843  ·  view source on GitHub ↗

iterate over each suspended thread to update highest priority in pending threads */

Source from the content-addressed store, hash-verified

826#ifdef RT_USING_MUTEX
827/* iterate over each suspended thread to update highest priority in pending threads */
828rt_inline rt_uint8_t _mutex_update_priority(struct rt_mutex *mutex)
829{
830 struct rt_thread *thread;
831
832 if (!rt_list_isempty(&mutex->parent.suspend_thread))
833 {
834 thread = RT_THREAD_LIST_NODE_ENTRY(mutex->parent.suspend_thread.next);
835 mutex->priority = rt_sched_thread_get_curr_prio(thread);
836 }
837 else
838 {
839 mutex->priority = 0xff;
840 }
841
842 return mutex->priority;
843}
844
845/* get highest priority inside its taken object and its init priority */
846rt_inline rt_uint8_t _thread_get_mutex_priority(struct rt_thread* thread)

Callers 1

_thread_update_priorityFunction · 0.85

Calls 2

rt_list_isemptyFunction · 0.85

Tested by

no test coverage detected