Commit 21484fb
committed
Fix T2C memory visibility race
The T2C compilation thread could set hot2 flag before compiled code was
fully visible to the main thread, causing execution of invalid function
pointers. This resulted in incorrect calculation results in the pi test.
Fixed by declaring hot2 as volatile to ensure proper cross-thread
visibility. The volatile qualifier guarantees fresh reads from memory
and prevents compiler optimizations that could reorder accesses.1 parent c75998b commit 21484fb
3 files changed
+5
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1122 | 1122 | | |
1123 | 1123 | | |
1124 | 1124 | | |
| 1125 | + | |
1125 | 1126 | | |
1126 | 1127 | | |
1127 | 1128 | | |
1128 | 1129 | | |
1129 | 1130 | | |
| 1131 | + | |
1130 | 1132 | | |
1131 | 1133 | | |
1132 | 1134 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
85 | 85 | | |
86 | 86 | | |
87 | 87 | | |
88 | | - | |
89 | | - | |
| 88 | + | |
| 89 | + | |
90 | 90 | | |
91 | 91 | | |
92 | 92 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
346 | 346 | | |
347 | 347 | | |
348 | 348 | | |
| 349 | + | |
349 | 350 | | |
350 | 351 | | |
351 | 352 | | |
| |||
0 commit comments