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

Function _check_and_update_prio

src/ipc.c:923–944  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

921}
922
923static rt_bool_t _check_and_update_prio(rt_thread_t thread, rt_mutex_t mutex)
924{
925 RT_SCHED_DEBUG_IS_LOCKED;
926 rt_bool_t do_sched = RT_FALSE;
927
928 if ((mutex->ceiling_priority != 0xFF) || (rt_sched_thread_get_curr_prio(thread) == mutex->priority))
929 {
930 rt_uint8_t priority = 0xff;
931
932 /* get the highest priority in the taken list of thread */
933 priority = _thread_get_mutex_priority(thread);
934
935 rt_sched_thread_change_priority(thread, priority);
936
937 /**
938 * notify a pending reschedule. Since scheduler is locked, we will not
939 * really do a re-schedule at this point
940 */
941 do_sched = RT_TRUE;
942 }
943 return do_sched;
944}
945
946static void _mutex_before_delete_detach(rt_mutex_t mutex)
947{

Callers 2

rt_mutex_releaseFunction · 0.85

Tested by

no test coverage detected