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; } }
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; } }