This is an automated email from the ASF dual-hosted git repository.

blankensteiner pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/pulsar-dotpulsar.git


The following commit(s) were added to refs/heads/master by this push:
     new 15a1967  Ensure correct exception is thrown from MoveNext() on dispose 
(#136)
15a1967 is described below

commit 15a1967b5566783a50a8e7acacdb19e45f016985
Author: Kristian Andersen <[email protected]>
AuthorDate: Tue Jan 31 10:42:47 2023 +0100

    Ensure correct exception is thrown from MoveNext() on dispose (#136)
---
 src/DotPulsar/Internal/AsyncQueueWithCursor.cs | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/src/DotPulsar/Internal/AsyncQueueWithCursor.cs 
b/src/DotPulsar/Internal/AsyncQueueWithCursor.cs
index f00f4ab..8089cb9 100644
--- a/src/DotPulsar/Internal/AsyncQueueWithCursor.cs
+++ b/src/DotPulsar/Internal/AsyncQueueWithCursor.cs
@@ -185,7 +185,14 @@ public sealed class AsyncQueueWithCursor<T> : 
IAsyncDisposable where T : IDispos
                 _cursorNextItemTcs = null;
             }
 
-            _cursorSemaphore.Release();
+            try
+            {
+                _cursorSemaphore.Release();
+            }
+            catch
+            {
+                // Ignore
+            }
 
             if (shouldThrow)
             {

Reply via email to