Commit 3306785
committed
Fix CancellationTokenMultiplexer return to pool
Fixes a operator precedence bug and adds tests.
If the PooledCancellationTokenSource had inlined tokens but no extraTokens, the Count would evaluate to 0 which would prevent the CancellationTokenRegistrations from being disposed.
The PooledCancellationTokenSource would then be returned to the pool but still be cancelable by the tokens which were preivously attached.1 parent 8813788 commit 3306785
File tree
2 files changed
+18
-1
lines changed- src
- DotNext.Tests/Threading
- DotNext.Threading/Threading
2 files changed
+18
-1
lines changedLines changed: 17 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
43 | 60 | | |
44 | 61 | | |
45 | 62 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
40 | | - | |
| 40 | + | |
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
| |||
0 commit comments