Commit 888c08a
Refactor CancellationContext
This change makes the countdown period non-configurable (motivation: it needs to match the clock implementation, which is already non-configurable) and allows grouping multiple SoftCheck() calls into a single SoftCheck(n) call.
Benchmarks:
name cpu/op
BM_CancellationContext_SoftCheck<1> 0.97ns ± 1%
BM_CancellationContext_SoftCheck<2> 1.45ns ± 1%
BM_CancellationContext_SoftCheck<4> 2.86ns ± 1%
BM_CancellationContext_SoftCheck<8> 5.61ns ± 1%
BM_CancellationContext_SoftCheck<-1> 11.4ns ± 1%
PiperOrigin-RevId: 721316028
Change-Id: I78bf9bcc7f9830dc6f32e4698ec597d86e7024bf1 parent b485841 commit 888c08a
3 files changed
+27
-29
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
254 | 254 | | |
255 | 255 | | |
256 | 256 | | |
257 | | - | |
258 | 257 | | |
259 | 258 | | |
260 | 259 | | |
| |||
297 | 296 | | |
298 | 297 | | |
299 | 298 | | |
300 | | - | |
301 | 299 | | |
302 | 300 | | |
303 | 301 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | | - | |
30 | 29 | | |
31 | 30 | | |
32 | 31 | | |
| |||
244 | 243 | | |
245 | 244 | | |
246 | 245 | | |
247 | | - | |
248 | | - | |
249 | | - | |
250 | | - | |
251 | | - | |
252 | | - | |
253 | | - | |
254 | | - | |
255 | | - | |
256 | | - | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
257 | 253 | | |
258 | | - | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
259 | 258 | | |
260 | | - | |
261 | | - | |
262 | | - | |
263 | | - | |
| 259 | + | |
264 | 260 | | |
265 | 261 | | |
266 | 262 | | |
267 | 263 | | |
268 | 264 | | |
269 | 265 | | |
270 | | - | |
271 | | - | |
272 | | - | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
273 | 271 | | |
274 | | - | |
275 | | - | |
276 | | - | |
277 | | - | |
| 272 | + | |
278 | 273 | | |
279 | 274 | | |
280 | 275 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
32 | 31 | | |
33 | 32 | | |
34 | 33 | | |
| |||
171 | 170 | | |
172 | 171 | | |
173 | 172 | | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
174 | 181 | | |
175 | | - | |
176 | | - | |
| 182 | + | |
177 | 183 | | |
178 | | - | |
179 | 184 | | |
180 | 185 | | |
181 | 186 | | |
| |||
0 commit comments