예제 #1
0
        /// <summary>
        ///     <para>Builds <see cref="Expression{Action}" /> and runs the <see cref="Action" /> in a separate thread.</para>
        /// </summary>
        /// <remarks>
        ///     After the <see cref="Action" /> is completed, this method signalizes other threads that are waiting
        ///     for the current thread completion.
        /// </remarks>
        public void Run()
        {
            new Thread(() =>
            {
                PersonalCountdownEvent?.Wait();

                _threadActionExpression?.Compile().Invoke();

                foreach (var countdownEvent in InjectedCountdownEventsList)
                {
                    countdownEvent.Signal();
                }
            }).Start();
        }
예제 #2
0
 public void Dispose() => PersonalCountdownEvent?.Dispose();