Skip to content

Commit c03b15e

Browse files
authored
Expose processes leveraged by BuildManager (#11146)
1 parent 96450a9 commit c03b15e

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/Build/BackEnd/BuildManager/BuildManager.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -820,6 +820,15 @@ void Callback(object? state)
820820
ThreadPoolExtensions.QueueThreadPoolWorkItemWithCulture(Callback, parentThreadCulture, parentThreadUICulture);
821821
}
822822

823+
/// <summary>
824+
/// Point in time snapshot of all worker processes leveraged by this BuildManager.
825+
/// This is meant to be used by VS. External users should not this is only best-effort, point-in-time functionality
826+
/// without guarantee of 100% correctness and safety.
827+
/// </summary>
828+
/// <returns>Enumeration of <see cref="Process"/> objects that were valid during the time of call to this function.</returns>
829+
public IEnumerable<Process> GetWorkerProcesses()
830+
=> (_nodeManager?.GetProcesses() ?? []).Concat(_taskHostNodeManager?.GetProcesses() ?? []);
831+
823832
/// <summary>
824833
/// Clears out all of the cached information.
825834
/// </summary>

0 commit comments

Comments
 (0)