File tree Expand file tree Collapse file tree 3 files changed +8
-13
lines changed
Expand file tree Collapse file tree 3 files changed +8
-13
lines changed Original file line number Diff line number Diff line change 22
33namespace PSParallelPipeline ;
44
5- internal class PoolSettings (
5+ internal sealed class PoolSettings (
66 int maxRunspaces ,
77 bool useNewRunspace ,
88 InitialSessionState initialSessionState )
Original file line number Diff line number Diff line change 22
33namespace PSParallelPipeline ;
44
5- internal class TaskSettings (
5+ internal sealed class TaskSettings (
66 string script ,
77 Dictionary < string , object ? > usingStatements )
88{
Original file line number Diff line number Diff line change @@ -55,7 +55,12 @@ private async Task Start()
5555 {
5656 if ( tasks . Count == tasks . Capacity )
5757 {
58- await ProcessAnyAsync ( tasks ) . ConfigureAwait ( false ) ;
58+ Task task = await Task
59+ . WhenAny ( tasks )
60+ . ConfigureAwait ( false ) ;
61+
62+ tasks . Remove ( task ) ;
63+ await task . ConfigureAwait ( false ) ;
5964 }
6065
6166 tasks . Add ( PSTask
@@ -75,16 +80,6 @@ await Task
7580 }
7681 }
7782
78- private static async Task ProcessAnyAsync ( List < Task > tasks )
79- {
80- Task task = await Task
81- . WhenAny ( tasks )
82- . ConfigureAwait ( false ) ;
83-
84- tasks . Remove ( task ) ;
85- await task . ConfigureAwait ( false ) ;
86- }
87-
8883 public void Dispose ( )
8984 {
9085 _pool . Dispose ( ) ;
You can’t perform that action at this time.
0 commit comments