mirror of
https://github.com/BepInEx/dotnet-runtime.git
synced 2026-11-23 03:39:35 -10:00
Fix Parallel.For* to consistently throw exception upon cancellation Fix for dotnet/corefx#20093 in master: - Write the exception to be thrown upon cancellation before setting the canceled state so that the exception will be visible upon cancellation - Dispose the cancellation token registration before checking the exception so that a late cancellation would never yield an incomplete return status with no exception Commit migrated from https://github.com/dotnet/corefx/commit/62bfba654acf00e4b0fc0811be057c637b135bba