fix: lazy TaskTracker workaround(closes #650)

This commit is contained in:
goaaats 2021-10-18 02:16:25 +02:00
parent dc88cec7d3
commit 6440a466ab
No known key found for this signature in database
GPG key ID: F18F057873895461
2 changed files with 38 additions and 1 deletions

View file

@ -1308,6 +1308,43 @@ namespace Dalamud.Interface.Internal.Windows
}); });
} }
if (ImGui.Button("Drown in tasks"))
{
Task.Run(() =>
{
for (var i = 0; i < 100; i++)
{
Task.Run(() =>
{
for (var i = 0; i < 100; i++)
{
Task.Run(() =>
{
for (var i = 0; i < 100; i++)
{
Task.Run(() =>
{
for (var i = 0; i < 100; i++)
{
Task.Run(() =>
{
for (var i = 0; i < 100; i++)
{
Thread.Sleep(1);
}
});
}
});
}
});
}
});
}
});
}
ImGui.SameLine();
ImGuiHelpers.ScaledDummy(20); ImGuiHelpers.ScaledDummy(20);
// Needed to init the task tracker, if we're not on a debug build // Needed to init the task tracker, if we're not on a debug build

View file

@ -33,7 +33,7 @@ namespace Dalamud.Logging.Internal
/// <summary> /// <summary>
/// Gets a read-only list of tracked tasks. /// Gets a read-only list of tracked tasks.
/// </summary> /// </summary>
public static IReadOnlyList<TaskInfo> Tasks => TrackedTasksInternal; public static IReadOnlyList<TaskInfo> Tasks => TrackedTasksInternal.ToArray();
/// <summary> /// <summary>
/// Clear the list of tracked tasks. /// Clear the list of tracked tasks.