Skip to content

Commit 5800e75

Browse files
committed
public worker count
1 parent db94b91 commit 5800e75

1 file changed

Lines changed: 11 additions & 3 deletions

File tree

GrasshopperAsyncComponent/GH_AsyncComponent.cs

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,18 +36,26 @@ public abstract class GH_AsyncComponent<T> : GH_Component, IDisposable
3636

3737
private readonly Action<string, double> _reportProgress;
3838

39-
public ConcurrentDictionary<string, double> ProgressReports { get; protected set; }
39+
public ConcurrentDictionary<string, double> ProgressReports { get; }
4040

4141
private readonly Timer _displayProgressTimer;
4242

43-
//JEDD: appears to be the number of workers that have completed
43+
/// <summary>
44+
/// a counter, used to count up the number of workers that have completed,
45+
/// until _setData is set true, when it starts to count down the workers as their data is set.
46+
/// </summary>
4447
private volatile int _state;
4548

46-
//JEDD: boolean, 1 if this class needs to set the data of the workers...
49+
/// <summary>
50+
/// functionally, a boolean, 1 or 0;
51+
/// it will be set to 1 once all workers are ready for SetData to be called on them, then set back to 0.
52+
/// </summary>
4753
private volatile int _setData;
4854

4955
private readonly List<Worker<T>> _workers;
5056

57+
public int WorkerCount => _workers.Count;
58+
5159
/// <summary>
5260
/// Set this property inside the constructor of your derived component.
5361
/// </summary>

0 commit comments

Comments
 (0)