@@ -194,31 +194,6 @@ rt_inline rt_err_t _rt_ipc_list_resume_all(rt_list_t *list)
194194 return RT_EOK ;
195195}
196196
197- /**
198- * This function will get the highest priority from the specified
199- * list of threads
200- *
201- * @param list of the threads
202- *
203- * @return the highest priority
204- */
205- rt_uint8_t _rt_ipc_get_highest_priority (rt_list_t * list )
206- {
207- struct rt_list_node * n ;
208- struct rt_thread * sthread ;
209- rt_uint8_t priority = RT_THREAD_PRIORITY_MAX - 1 ;
210-
211- for (n = list -> next ; n != list ; n = n -> next )
212- {
213- sthread = rt_list_entry (n , struct rt_thread , tlist );
214-
215- priority = priority < sthread -> current_priority ?
216- priority :
217- sthread -> current_priority ;
218- }
219- return priority ;
220- }
221-
222197#ifdef RT_USING_SEMAPHORE
223198/**
224199 * This function will initialize a semaphore and put it under control of
@@ -870,7 +845,6 @@ rt_err_t rt_mutex_release(rt_mutex_t mutex)
870845 register rt_base_t temp ;
871846 struct rt_thread * thread ;
872847 rt_bool_t need_schedule ;
873- rt_uint8_t max_priority_in_queue = RT_THREAD_PRIORITY_MAX - 1 ;
874848
875849 /* parameter check */
876850 RT_ASSERT (mutex != RT_NULL );
@@ -932,21 +906,6 @@ rt_err_t rt_mutex_release(rt_mutex_t mutex)
932906 mutex -> owner = thread ;
933907 mutex -> original_priority = thread -> current_priority ;
934908
935- /* Priority adjustment occurs only when the following conditions
936- * are met simultaneously:
937- * 1.The type of mutex is RT_IPC_FLAG_FIFO;
938- * 2.The priority of the thread to be resumed is not equal to the
939- * highest priority in the queue;
940- */
941- max_priority_in_queue = _rt_ipc_get_highest_priority (& mutex -> parent .suspend_thread );
942- if (mutex -> parent .parent .flag == RT_IPC_FLAG_FIFO &&
943- thread -> current_priority != max_priority_in_queue )
944- {
945- rt_thread_control (thread ,
946- RT_THREAD_CTRL_CHANGE_PRIORITY ,
947- & (max_priority_in_queue ));
948- }
949-
950909 if (mutex -> hold < RT_MUTEX_HOLD_MAX )
951910 {
952911 mutex -> hold ++ ;
0 commit comments