Allow bounded channel to be created with drop delegate (#50331)
* Bounded channel can be created with drop delegate.
- Add additional CreateBounded overload with delegate parameter that will be called when item is being dropped from channel
- Added unit tests
* Fix typo in comment.
* Apply suggestions from code review
Co-authored-by: Stephen Toub <stoub@microsoft.com>
* Call drop delegate outside of lock statement.
* Use overload of CreateBounded method instead of calling ctor directly.
* Code review suggestions refactor.
* Move Monitor.Enter before try and use local scoped parent variable everywhere.
* Drop delegate should not be called while sync lock is held.
Enqueuing of new item should be done while sync lock is being held.
Added additional tests.
* Rerun gitlab CI.
* Do not run deadlock test for bounded channels if platform do not support threading.
* Apply suggestions from code review
Co-authored-by: Ivan Benovic <ivan.benovic@innovatrics.com>
Co-authored-by: Stephen Toub <stoub@microsoft.com>