Skip to content

Conversation

@mikasoukhov
Copy link
Contributor

This commit fixes critical issues in BaseOrderedChannel implementation:

  1. Restored async signature of Enqueue method with CancellationToken support

    • Changed from synchronous blocking (AsyncHelper.Run) to proper async/await
    • This prevents thread blocking and deadlocks, especially in bounded channels
    • Allows cancellation of write operations
  2. Fixed tests to use async Add method

    • Updated all test methods to properly await Add operations
    • Ensures tests correctly validate async behavior
  3. Added clarifying documentation to Count property

    • Documented that Count only reflects items in sorted collection
    • Not including items still in the channel buffer

These changes fix potential deadlocks and restore proper async behavior.

This commit fixes critical issues in BaseOrderedChannel implementation:

1. Restored async signature of Enqueue method with CancellationToken support
   - Changed from synchronous blocking (AsyncHelper.Run) to proper async/await
   - This prevents thread blocking and deadlocks, especially in bounded channels
   - Allows cancellation of write operations

2. Fixed tests to use async Add method
   - Updated all test methods to properly await Add operations
   - Ensures tests correctly validate async behavior

3. Added clarifying documentation to Count property
   - Documented that Count only reflects items in sorted collection
   - Not including items still in the channel buffer

These changes fix potential deadlocks and restore proper async behavior.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants