| 921 | } |
| 922 | |
| 923 | static 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 | |
| 946 | static void _mutex_before_delete_detach(rt_mutex_t mutex) |
| 947 | { |
no test coverage detected