src/openSourceC.DotNetLibrary.Core/Threading/ThreadSet.cs
/// <summary>
///		Create a new <see cref="T:Thread"/> using the specified <see cref="T:ThreadStart"/>
///		and add it to the set.
/// </summary>
/// <remarks>
///		Each thread should signal the <see cref="T:CountdownEvent"/> once, and only once, to
///		indicate that the thread has successfully started.  The <see cref="M:Wait()"/>
///		methods can then be used to allow the system to wait until all threads are fully
///		operational.
///		<para>NOTE: There is no guarantee that all threads will successfully start.</para>
/// </remarks>
/// <param name="start">A <see cref="T:ParameterizedThreadStart"/> delegate that represents
///		the method to be invoked when this thread begins executing.</param>
/// <param name="parameter">The parameter object to pass to the invoked method.</param>
/// <param name="name">The name of the thread, or <b>null</b>. (Optional, defaults to null)</param>
Create a new  using the specified
and add it to the set.
Create a new using the specified and add it to the set .
public void CreateAdd<TParameter>(ParameterizedThreadStart start, TParameter parameter, string? name = null)
		{
			if (!_servicesCountdownEvent.TryAddCount())
			{
				throw new InvalidOperationException("Unable to increment countdown events.");
			}
			if (start == null)
			{
				throw new ArgumentNullException(nameof(start));
			}
			lock (((ICollection)_threads).SyncRoot)
			{
				ParameterizedThreadSetItem<TParameter> threadSetItem = new(
					new Thread(start)
					{
						Name = (name is not null ? name : start.Method.Name),
					},
					parameter
				);
				_threads.Add(threadSetItem);
			}
		}
public void CreateAdd < TParameter > ( ParameterizedThreadStart start , TParameter parameter , string ? name = null ) { if ( ! _servicesCountdownEvent . TryAddCount ( ) ) { throw new InvalidOperationException ( " " ) ; } if ( start == null ) { throw new ArgumentNullException ( nameof ( start ) ) ; } lock ( ( ( ICollection ) _threads ) . SyncRoot ) { ParameterizedThreadSetItem < TParameter > threadSetItem = new ( new Thread ( start ) { Name = ( name is not null ? name : start . Method . Name ) , } , parameter ) ; _threads . Add ( threadSetItem ) ; } }
Create a new  using the specified
and add it to the set.
Create a new using the specified and add it to the set .
// Add 1 to the countdown for the thread being added.
start
ParameterizedThreadStart
A  delegate that represents
the method to be invoked when this thread begins executing.
A delegate that represents the method to be invoked when this thread begins executing .
parameter
TParameter
The parameter object to pass to the invoked method.
The parameter object to pass to the invoked method .
name
string?
The name of the thread, or null
The name of the thread or null
remarks
Each thread should signal the  once, and only once, to
indicate that the thread has successfully started.  The
methods can then be used to allow the system to wait until all threads are fully
operational.
NOTE: There is no guarantee that all threads will successfully start.
Each thread should signal the once and only once to indicate that the thread has successfully started . The methods can then be used to allow the system to wait until all threads are fully operational . NOTE : There is no guarantee that all threads will successfully start .