Commit 761499d
Improve race condition by disposing scope after starting reset task
The previous version disposed the scope before starting the reset task, which
eliminated the race condition. Now the test:
1. Starts the resetTask which yields then calls ResetState()
2. Immediately disposes the scope on the main thread
3. The scope disposal triggers TransactionCompleted event asynchronously
4. This creates a proper race between HandleTransactionCompleted and ClearTransactions
This maintains thread-safety constraints (scope disposal on same thread) while
creating the intended race condition between the event handler and ResetState().
Co-authored-by: cincuranet <4540597+cincuranet@users.noreply.github.com>1 parent aeaba76 commit 761499d
1 file changed
+13
-11
lines changedLines changed: 13 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1095 | 1095 | | |
1096 | 1096 | | |
1097 | 1097 | | |
1098 | | - | |
1099 | | - | |
1100 | | - | |
1101 | | - | |
1102 | | - | |
1103 | | - | |
| 1098 | + | |
| 1099 | + | |
| 1100 | + | |
1104 | 1101 | | |
1105 | | - | |
1106 | | - | |
| 1102 | + | |
| 1103 | + | |
1107 | 1104 | | |
1108 | 1105 | | |
1109 | 1106 | | |
1110 | | - | |
1111 | | - | |
| 1107 | + | |
| 1108 | + | |
1112 | 1109 | | |
1113 | 1110 | | |
1114 | 1111 | | |
| |||
1122 | 1119 | | |
1123 | 1120 | | |
1124 | 1121 | | |
1125 | | - | |
| 1122 | + | |
| 1123 | + | |
| 1124 | + | |
| 1125 | + | |
| 1126 | + | |
| 1127 | + | |
1126 | 1128 | | |
1127 | 1129 | | |
1128 | 1130 | | |
| |||
0 commit comments