-
Notifications
You must be signed in to change notification settings - Fork 751
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
4.x: Rework TakeUntil with lock-free methods #550
Conversation
} | ||
else | ||
ForwardOnNext(value); | ||
if (Interlocked.Decrement(ref halfSerializer) != 0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's that halfSerializer for ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mutually excludes the call to OnNext
with any calls to OnError
or OnCompleted
, deferring them after the OnNext
returns.
You mind if I try to tidy this up a bit and send you a PR? |
Tidy up how? |
Stylistically and less noise. I'll make a try and we can discuss. |
@@ -24,131 +25,118 @@ public TakeUntil(IObservable<TSource> source, IObservable<TOther> other) | |||
|
|||
internal sealed class _ : IdentitySink<TSource> | |||
{ | |||
private readonly OtherObserver _other; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Field can be omitted, good to be merged otherwise.
This PR updates the internal logic of the
TakeUntil
to use a lock-free signalling algorithm for all event types.