Commit 3f38971
authored
Moved a static field initialization from Thread to ProcessorIdCache (#114227)
Presence of `.cctor` in `Thread` can cause circular dependency if Lock needs to block while Thread .cctor has not run yet.
1. Lock needs to wait on a WaitHandle
2. WaitHandle needs Thread.CurrentThread
3. if Thread's .cctor has not run yet, it needs to run.
(it is unusual for this to be the first use of Thread, but the activation pattern in #113949 made it possible)
4. .cctor needs to take a Lock, so we go to `#1`
Fixes: #1139491 parent fc856a2 commit 3f38971
File tree
2 files changed
+7
-7
lines changed- src/libraries/System.Private.CoreLib/src/System/Threading
2 files changed
+7
-7
lines changedLines changed: 7 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
25 | 29 | | |
26 | 30 | | |
27 | 31 | | |
| |||
44 | 48 | | |
45 | 49 | | |
46 | 50 | | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
47 | 54 | | |
48 | 55 | | |
49 | 56 | | |
| |||
Lines changed: 0 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
719 | 719 | | |
720 | 720 | | |
721 | 721 | | |
722 | | - | |
723 | | - | |
724 | | - | |
725 | 722 | | |
726 | 723 | | |
727 | 724 | | |
728 | | - | |
729 | | - | |
730 | | - | |
731 | | - | |
732 | 725 | | |
733 | 726 | | |
734 | 727 | | |
| |||
0 commit comments