Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,6 @@ internal sealed class RedoSerializedObserver<X> : IObserver<X>
private readonly IObserver<X> _downstream;
private int _wip;
private Exception _terminalException;
private static readonly Exception DoneIndicator = new Exception();
private static readonly Exception SignaledIndicator = new Exception();
private readonly ConcurrentQueue<X> _queue;

Expand All @@ -173,7 +172,7 @@ internal RedoSerializedObserver(IObserver<X> downstream)

public void OnCompleted()
{
if (Interlocked.CompareExchange(ref _terminalException, DoneIndicator, null) == null)
if (Interlocked.CompareExchange(ref _terminalException, ExceptionHelper.Terminated, null) == null)
{
Drain();
}
Expand Down Expand Up @@ -218,7 +217,7 @@ private void Drain()
if (ex != SignaledIndicator)
{
Interlocked.Exchange(ref _terminalException, SignaledIndicator);
if (ex != DoneIndicator)
if (ex != ExceptionHelper.Terminated)
{
_downstream.OnError(ex);
}
Expand Down