From c03b15ef99b52a89a4942eacec42f4dfe0f5bc55 Mon Sep 17 00:00:00 2001 From: Jan Krivanek Date: Fri, 3 Jan 2025 14:31:05 +0100 Subject: [PATCH] Expose processes leveraged by BuildManager (#11146) --- src/Build/BackEnd/BuildManager/BuildManager.cs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/Build/BackEnd/BuildManager/BuildManager.cs b/src/Build/BackEnd/BuildManager/BuildManager.cs index c4a13d02dca..10cf3577bf1 100644 --- a/src/Build/BackEnd/BuildManager/BuildManager.cs +++ b/src/Build/BackEnd/BuildManager/BuildManager.cs @@ -820,6 +820,15 @@ void Callback(object? state) ThreadPoolExtensions.QueueThreadPoolWorkItemWithCulture(Callback, parentThreadCulture, parentThreadUICulture); } + /// + /// Point in time snapshot of all worker processes leveraged by this BuildManager. + /// This is meant to be used by VS. External users should not this is only best-effort, point-in-time functionality + /// without guarantee of 100% correctness and safety. + /// + /// Enumeration of objects that were valid during the time of call to this function. + public IEnumerable GetWorkerProcesses() + => (_nodeManager?.GetProcesses() ?? []).Concat(_taskHostNodeManager?.GetProcesses() ?? []); + /// /// Clears out all of the cached information. ///