fix (pre-emptive): Fix typo (check val == 1, not 0)

Bugs (fixed):
   The IObservable.StopAfter ext fn never actually stops the sequence
   (even after the timeout expires).
This commit is contained in:
John Colvin committed 2023-03-20 13:26:43 -04:00
1 parent d5de60bc21
commit 2008478378
1 file changed
+2 -2
@@ -324,14 +324,14 @@ namespace System.Reactive.Linq {
}
void on_complete() {
if (Interlocked.Increment(ref state) == 0) {
if (Interlocked.Increment(ref state) == 1) {
o.OnCompleted();
Disposable.dispose(ref sub);
}
}
void dispose() {
if (Interlocked.Increment(ref state) == 0) {
if (Interlocked.Increment(ref state) == 1) {
Disposable.dispose(ref sub);
}
}