Skip to content

Instantly share code, notes, and snippets.

IAsyncEnumerator<int> IAsyncEnumerable<int>.GetAsyncEnumerator(CancellationToken consumerCancellationToken)
{
Program.CProduceEd__2 produceD2;
if (this.CE1__state == -2 && this.CEl__initialThreadId == Environment.CurrentManagedThreadId)
{
this.CE1__state = -3;
this.CEt__builder = AsyncIteratorMethodBuilder.Create();
this.CEw__disposeMode = false;
produceD2 = this;
}
else
produceD2 = new Program.CProduceEd__2(-3);
if (this.producerCancellationToken.Equals(new CancellationToken()))
produceD2.cancellationToken = consumerCancellationToken;
else if (consumerCancellationToken.Equals(this.producerCancellationToken) || consumerCancellationToken.Equals(new CancellationToken()))
{
produceD2.cancellationToken = this.producerCancellationToken;
}
else
{
this.CEx__combinedTokens = CancellationTokenSource.CreateLinkedTokenSource(this.producerCancellationToken, consumerCancellationToken);
produceD2.cancellationToken = this.CEx__combinedTokens.Token;
}
return (IAsyncEnumerator<int>)produceD2;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment