From 1323874389030c55fb053fead12ca1c6654d8851 Mon Sep 17 00:00:00 2001 From: zhushengle Date: Thu, 6 May 2021 11:00:44 +0800 Subject: [PATCH] fix: Sortlink, the response time to insert the node should be inserted into the back of the existing node. Close #I3PSJ8 Change-Id: Ib630ba4febbc21d4f25af0961f5c996eadf4e054 --- kernel/base/core/los_sortlink.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/kernel/base/core/los_sortlink.c b/kernel/base/core/los_sortlink.c index bca4e570..8a997e50 100644 --- a/kernel/base/core/los_sortlink.c +++ b/kernel/base/core/los_sortlink.c @@ -55,10 +55,14 @@ STATIC INLINE VOID OsAddNode2SortLink(SortLinkAttribute *sortLinkHeader, SortLin } SortLinkList *listSorted = LOS_DL_LIST_ENTRY(head->pstNext, SortLinkList, sortLinkNode); - if (listSorted->responseTime >= sortList->responseTime) { + if (listSorted->responseTime > sortList->responseTime) { LOS_ListAdd(head, &sortList->sortLinkNode); sortLinkHeader->nodeNum++; return; + } else if (listSorted->responseTime == sortList->responseTime) { + LOS_ListAdd(head->pstNext, &sortList->sortLinkNode); + sortLinkHeader->nodeNum++; + return; } LOS_DL_LIST *prevNode = head->pstPrev; -- GitLab