Add OS thread ID info to the Resource Logger

This commit is contained in:
Exter-N 2025-07-04 19:41:31 +02:00
parent 62e9dc164d
commit 30e3cd1f38
3 changed files with 33 additions and 1 deletions

View file

@ -30,7 +30,8 @@ internal sealed class ResourceWatcherTable : Table<Record>
new LoadStateColumn { Label = "State" },
new RefCountColumn { Label = "#Ref" },
new DateColumn { Label = "Time" },
new Crc64Column { Label = "Crc64" }
new Crc64Column { Label = "Crc64" },
new OsThreadColumn { Label = "TID" }
)
{ }
@ -453,4 +454,19 @@ internal sealed class ResourceWatcherTable : Table<Record>
public override int Compare(Record lhs, Record rhs)
=> lhs.RefCount.CompareTo(rhs.RefCount);
}
private sealed class OsThreadColumn : ColumnString<Record>
{
public override float Width
=> 60 * UiHelpers.Scale;
public override string ToName(Record item)
=> item.OsThreadId.ToString();
public override void DrawColumn(Record item, int _)
=> ImGuiUtil.RightAlign(ToName(item));
public override int Compare(Record lhs, Record rhs)
=> lhs.OsThreadId.CompareTo(rhs.OsThreadId);
}
}