File tree Expand file tree Collapse file tree
Source/Libraries/GSF.Core/IO Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -361,12 +361,13 @@ async Task VisitFileAsync(FileInfo file)
361361 bool matchesFilter = m_fileProcessor . MatchesFilter ( trackedPath ) ;
362362
363363 // The file must be processed on the processing thread
364- await processingThread . Join ( FileProcessor . ProcessNormalPriority ) ;
365-
366- if ( matchesFilter )
367- m_fileProcessor . TouchAndProcess ( trackedPath , lastWriteTime , false ) ;
368- else
369- m_fileProcessor . TouchAndSkip ( trackedPath , lastWriteTime ) ;
364+ processingThread . Push ( FileProcessor . ProcessNormalPriority , ( ) =>
365+ {
366+ if ( matchesFilter )
367+ m_fileProcessor . TouchAndProcess ( trackedPath , lastWriteTime , false ) ;
368+ else
369+ m_fileProcessor . TouchAndSkip ( trackedPath , lastWriteTime ) ;
370+ } ) ;
370371 }
371372
372373 async Task EnumerateSubdirectoriesAsync ( )
@@ -398,10 +399,6 @@ async Task EnumerateFilesAsync()
398399
399400 IEnumerable < Task > processTasks = files . Select ( VisitFileAsync ) ;
400401 await Task . WhenAll ( processTasks ) . ConfigureAwait ( false ) ;
401-
402- // The continuation of VisitFileAsync() will execute on the
403- // processing thread so we need to join back to the appropriate thread
404- await enumerationThread . Join ( ) ;
405402 }
406403
407404 EventHandler < EventArgs < List < string > > > handler = ( sender , args ) =>
You can’t perform that action at this time.
0 commit comments