Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Fix CancellationTokenMultiplexer return to pool#272

Merged
sakno merged 1 commit into
dotnet:developdotnet/dotNext:developfrom
timothycoleman:fix-cancellation-token-multiplexer-poolingtimothycoleman/dotNext:fix-cancellation-token-multiplexer-poolingCopy head branch name to clipboard
Sep 28, 2025
Merged

Fix CancellationTokenMultiplexer return to pool#272
sakno merged 1 commit into
dotnet:developdotnet/dotNext:developfrom
timothycoleman:fix-cancellation-token-multiplexer-poolingtimothycoleman/dotNext:fix-cancellation-token-multiplexer-poolingCopy head branch name to clipboard

Conversation

@timothycoleman

Copy link
Copy Markdown
Contributor

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 previously attached.

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.
@timothycoleman

Copy link
Copy Markdown
Contributor Author

@dotnet-policy-service agree

@sakno sakno added the bug label Sep 28, 2025
@sakno sakno added this to Core Sep 28, 2025
@github-project-automation github-project-automation Bot moved this to Opened in Core Sep 28, 2025
@sakno
sakno merged commit b3b0286 into dotnet:develop Sep 28, 2025
5 checks passed
@github-project-automation github-project-automation Bot moved this from Opened to Closed in Core Sep 28, 2025
@timothycoleman
timothycoleman deleted the fix-cancellation-token-multiplexer-pooling branch September 29, 2025 08:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Closed

Development

Successfully merging this pull request may close these issues.

2 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.