Skip to content
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

Merged
merged 7 commits into from
May 30, 2018

Conversation

akarnokd
Copy link
Collaborator

This PR updates the internal logic of the TakeUntil to use a lock-free signalling algorithm for all event types.

}
else
ForwardOnNext(value);
if (Interlocked.Decrement(ref halfSerializer) != 0)
Copy link
Collaborator

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 ?

Copy link
Collaborator Author

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.

@danielcweber
Copy link
Collaborator

You mind if I try to tidy this up a bit and send you a PR?

@akarnokd
Copy link
Collaborator Author

Tidy up how?

@danielcweber
Copy link
Collaborator

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;
Copy link
Collaborator

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.

@danielcweber danielcweber merged commit caf6203 into dotnet:master May 30, 2018
@akarnokd akarnokd deleted the TakeUntilLockFree branch May 30, 2018 13:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants