Ejemplo n.º 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();
        }
Ejemplo n.º 2
0
 public void Dispose() => PersonalCountdownEvent?.Dispose();