@@ -8,13 +8,14 @@ namespace Shuttle.Core.Threading
88{
99 public class ProcessorThreadPool : IProcessorThreadPool
1010 {
11- private readonly string _name ;
12- private readonly IProcessorFactory _processorFactory ;
13- private readonly ProcessorThreadOptions _processorThreadOptions ;
11+ public string Name { get ; }
12+ public IProcessorFactory ProcessorFactory { get ; }
13+ public ProcessorThreadOptions ThreadOptions { get ; }
14+ public int ThreadCount { get ; }
15+
1416 private readonly List < ProcessorThread > _processorThreads = new List < ProcessorThread > ( ) ;
1517 private bool _disposed ;
1618 private bool _started ;
17- private readonly int _threadCount ;
1819
1920 public ProcessorThreadPool ( string name , int threadCount , IProcessorFactory processorFactory , ProcessorThreadOptions processorThreadOptions )
2021 {
@@ -26,10 +27,10 @@ public ProcessorThreadPool(string name, int threadCount, IProcessorFactory proce
2627 throw new ThreadCountZeroException ( ) ;
2728 }
2829
29- _name = name ?? Guid . NewGuid ( ) . ToString ( ) ;
30- _processorFactory = processorFactory ;
31- _processorThreadOptions = processorThreadOptions ;
32- _threadCount = threadCount ;
30+ Name = name ?? Guid . NewGuid ( ) . ToString ( ) ;
31+ ProcessorFactory = processorFactory ;
32+ ThreadOptions = processorThreadOptions ;
33+ ThreadCount = threadCount ;
3334 }
3435
3536 public event EventHandler < ProcessorThreadCreatedEventArgs > ProcessorThreadCreated ;
@@ -74,9 +75,9 @@ private async Task Start(bool sync)
7475
7576 var i = 0 ;
7677
77- while ( i ++ < _threadCount )
78+ while ( i ++ < ThreadCount )
7879 {
79- var processorThread = new ProcessorThread ( $ "{ _name } / { i } ", _processorFactory . Create ( ) , _processorThreadOptions ) ;
80+ var processorThread = new ProcessorThread ( $ "{ Name } / { i } ", ProcessorFactory . Create ( ) , ThreadOptions ) ;
8081
8182 ProcessorThreadCreated ? . Invoke ( this , new ProcessorThreadCreatedEventArgs ( processorThread ) ) ;
8283
@@ -114,7 +115,7 @@ protected virtual void Dispose(bool disposing)
114115 thread . Stop ( ) ;
115116 }
116117
117- _processorFactory . TryDispose ( ) ;
118+ ProcessorFactory . TryDispose ( ) ;
118119 }
119120
120121 _disposed = true ;
0 commit comments