Example #1
0
        private void Update(object state)
        {
            int index = (int)state;

            goto Start;

Work:
            Volatile.Read(ref _currentRunnable).Run(index, _tasks.Length);

            _barrier.Signal();

Start:
            _barrier.Start();

            if (!_disposeHandle.IsCancellationRequested)
            {
                goto Work;
            }
        }
Example #2
0
        private void Update(object state)
        {
            int index = (int)state;

#if !NETSTANDARD1_1
            Thread.CurrentThread.Name = $"{nameof(DefaultParallelRunner)} worker {index + 1}";
#endif

            goto Start;

Work:
            Volatile.Read(ref _currentRunnable).Run(index, _tasks.Length);

            _barrier.Signal();

Start:
            _barrier.Start();

            if (!_disposeHandle.IsCancellationRequested)
            {
                goto Work;
            }
        }