Commit 105bbc8
committed
Preemptive cancellation of TaskContext jobs
- Enable pre-execution cancellation in TaskContext by registering a
cancellation token in constructor that invokes PreExecuteCancel()
- Clear cancellation token in ~TaskContextImpl to prevent dangling refs
- Fix CancellationContext::CancelOperation() to swap out the token
before calling Cancel(), avoiding re-entrancy issues
- Update BlockingCancel test to cover pre-execution cancellation
Relates-To: HERESDK-12253
Signed-off-by: Mykhailo Diachenko <ext-mykhailo.z.diachenko@here.com>1 parent b400ee0 commit 105bbc8
File tree
5 files changed
+83
-26
lines changed- olp-cpp-sdk-core
- include/olp/core/client
- tests/client
- olp-cpp-sdk-dataservice-read/tests
5 files changed
+83
-26
lines changedLines changed: 4 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| 22 | + | |
22 | 23 | | |
23 | 24 | | |
24 | 25 | | |
| |||
58 | 59 | | |
59 | 60 | | |
60 | 61 | | |
61 | | - | |
62 | | - | |
| 62 | + | |
| 63 | + | |
63 | 64 | | |
| 65 | + | |
64 | 66 | | |
65 | 67 | | |
66 | 68 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
193 | 193 | | |
194 | 194 | | |
195 | 195 | | |
196 | | - | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
197 | 203 | | |
198 | | - | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
199 | 209 | | |
200 | 210 | | |
201 | 211 | | |
| |||
249 | 259 | | |
250 | 260 | | |
251 | 261 | | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
252 | 296 | | |
253 | 297 | | |
254 | 298 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
136 | 136 | | |
137 | 137 | | |
138 | 138 | | |
139 | | - | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
140 | 146 | | |
141 | | - | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
142 | 151 | | |
143 | | - | |
| 152 | + | |
144 | 153 | | |
145 | | - | |
| 154 | + | |
146 | 155 | | |
147 | | - | |
148 | | - | |
| 156 | + | |
| 157 | + | |
149 | 158 | | |
150 | | - | |
151 | | - | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
152 | 162 | | |
153 | 163 | | |
154 | 164 | | |
| |||
Lines changed: 10 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
20 | 21 | | |
21 | 22 | | |
22 | 23 | | |
| |||
1138 | 1139 | | |
1139 | 1140 | | |
1140 | 1141 | | |
1141 | | - | |
1142 | | - | |
1143 | | - | |
1144 | | - | |
| 1142 | + | |
| 1143 | + | |
| 1144 | + | |
| 1145 | + | |
| 1146 | + | |
| 1147 | + | |
| 1148 | + | |
1145 | 1149 | | |
1146 | 1150 | | |
1147 | 1151 | | |
1148 | 1152 | | |
1149 | | - | |
| 1153 | + | |
| 1154 | + | |
1150 | 1155 | | |
1151 | 1156 | | |
1152 | 1157 | | |
| |||
Lines changed: 5 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
357 | 357 | | |
358 | 358 | | |
359 | 359 | | |
360 | | - | |
361 | 360 | | |
362 | 361 | | |
363 | 362 | | |
364 | 363 | | |
365 | | - | |
366 | 364 | | |
367 | 365 | | |
368 | 366 | | |
| |||
1013 | 1011 | | |
1014 | 1012 | | |
1015 | 1013 | | |
1016 | | - | |
1017 | | - | |
| 1014 | + | |
1018 | 1015 | | |
1019 | 1016 | | |
1020 | 1017 | | |
| |||
1023 | 1020 | | |
1024 | 1021 | | |
1025 | 1022 | | |
1026 | | - | |
1027 | | - | |
1028 | | - | |
1029 | | - | |
1030 | | - | |
| 1023 | + | |
| 1024 | + | |
| 1025 | + | |
| 1026 | + | |
1031 | 1027 | | |
1032 | 1028 | | |
1033 | 1029 | | |
| |||
0 commit comments