Skip to content

Commit ee5adb6

Browse files
committed
Fix sorting thread affinity/ideal processor
1 parent 4330aac commit ee5adb6

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

ProcessHacker/thrdlist.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* thread list
44
*
55
* Copyright (C) 2011-2012 wj32
6-
* Copyright (C) 2018-2021 dmex
6+
* Copyright (C) 2018-2022 dmex
77
*
88
* This file is part of Process Hacker.
99
*
@@ -602,7 +602,8 @@ END_SORT_FUNCTION
602602

603603
BEGIN_SORT_FUNCTION(IdealProcessor)
604604
{
605-
sortResult = PhCompareStringZ(node1->IdealProcessorText, node2->IdealProcessorText, TRUE);
605+
sortResult = uint64cmp(node1->IdealProcessorMask, node2->IdealProcessorMask);
606+
//sortResult = PhCompareStringZ(node1->IdealProcessorText, node2->IdealProcessorText, TRUE);
606607
}
607608
END_SORT_FUNCTION
608609

@@ -1049,6 +1050,8 @@ BOOLEAN NTAPI PhpThreadTreeNewCallback(
10491050
{
10501051
if (NT_SUCCESS(PhGetThreadIdealProcessor(threadItem->ThreadHandle, &idealProcessorNumber)))
10511052
{
1053+
node->IdealProcessorMask = MAKELONG(idealProcessorNumber.Group, idealProcessorNumber.Number);
1054+
10521055
PhInitFormatU(&format[0], idealProcessorNumber.Group);
10531056
PhInitFormatC(&format[1], L':');
10541057
PhInitFormatU(&format[2], idealProcessorNumber.Number);

0 commit comments

Comments
 (0)