1207 {
1209 if (!
source.SupportsDynamicPartitions)
1210 {
1212 }
1215 if (ParallelEtwProvider.Log.IsEnabled())
1216 {
1218 ParallelEtwProvider.Log.ParallelLoopBegin(TaskScheduler.Current.Id,
Task.CurrentId.GetValueOrDefault(),
forkJoinContextID, ParallelEtwProvider.ForkJoinOperationType.ParallelForEach, 0
L, 0
L);
1219 }
1221 ParallelLoopResult result = default(ParallelLoopResult);
1222 OperationCanceledException
oce =
null;
1224 {
1227 }, (object?)null));
1231 {
1234 {
1236 }
1237 }
1238 else
1239 {
1242 {
1244 }
1245 }
1246 try
1247 {
1248 try
1249 {
1251 {
1253 if (ParallelEtwProvider.Log.IsEnabled())
1254 {
1255 ParallelEtwProvider.Log.ParallelFork(TaskScheduler.Current.Id, Task.CurrentId.GetValueOrDefault(), forkJoinContextID);
1256 }
1258 bool flag = false;
1259 try
1260 {
1263 {
1265 }
1267 {
1270 {
1272 flag = true;
1273 }
1274 }
1277 {
1280 {
1282 }
1284 {
1286 }
1288 {
1290 long key = current.Key;
1291 TSource
value = current.Value;
1293 {
1294 parallelLoopState.CurrentIteration =
key;
1295 }
1297 {
1299 }
1301 {
1303 }
1305 {
1307 }
1308 else
1309 {
1311 }
1313 {
1314 break;
1315 }
1317 {
1319 break;
1320 }
1321 }
1322 }
1323 else
1324 {
1327 {
1329 }
1331 {
1333 }
1335 {
1336 parallelLoopState.CurrentIteration = 0
L;
1337 }
1339 {
1342 {
1344 }
1346 {
1348 }
1350 {
1352 }
1354 {
1355 break;
1356 }
1358 {
1360 break;
1361 }
1362 }
1363 }
1364 }
1366 {
1369 }
1370 finally
1371 {
1373 {
1375 }
1377 {
1379 }
1380 if (ParallelEtwProvider.Log.IsEnabled())
1381 {
1382 ParallelEtwProvider.Log.ParallelJoin(TaskScheduler.Current.Id,
Task.CurrentId.GetValueOrDefault(),
forkJoinContextID);
1383 }
1384 }
1386 }
1387 finally
1388 {
1390 {
1392 }
1393 }
1395 {
1397 }
1398 }
1399 catch (AggregateException
ex)
1400 {
1402 }
1403 finally
1404 {
1408 {
1410 }
1413 if (ParallelEtwProvider.Log.IsEnabled())
1414 {
1415 ParallelEtwProvider.Log.ParallelLoopEnd(TaskScheduler.Current.Id,
Task.CurrentId.GetValueOrDefault(),
forkJoinContextID, 0
L);
1416 }
1417 }
1418 return result;
1419 }
Enumerator GetEnumerator()
static string Parallel_ForEach_NullEnumerator
static string Parallel_ForEach_PartitionerNotDynamic
static string Parallel_ForEach_PartitionerReturnedNull
static int ComputeTimeoutPoint(int timeoutLength)
static int s_forkJoinContextID
static void ThrowSingleCancellationExceptionOrOtherException(ICollection exceptions, CancellationToken cancelToken, Exception otherException)
static bool CheckTimeoutReached(int timeoutOccursAt)
@ InvalidOperationException