Skip to content

Commit

Permalink
Merge pull request #499 from Cysharp/hadashiA/fix-completion-source-r…
Browse files Browse the repository at this point in the history
…etval

Fix conditions for UniTaskCompletionSourceCore.TrySet* to be true
  • Loading branch information
hadashiA authored Sep 14, 2023
2 parents 6a89ea8 + 50ad2ee commit 8a022ee
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,8 @@ public bool TrySetResult(TResult result)
if (continuation != null || Interlocked.CompareExchange(ref this.continuation, UniTaskCompletionSourceCoreShared.s_sentinel, null) != null)
{
continuation(continuationState);
return true;
}
return true;
}

return false;
Expand All @@ -165,8 +165,8 @@ public bool TrySetException(Exception error)
if (continuation != null || Interlocked.CompareExchange(ref this.continuation, UniTaskCompletionSourceCoreShared.s_sentinel, null) != null)
{
continuation(continuationState);
return true;
}
return true;
}

return false;
Expand All @@ -184,8 +184,8 @@ public bool TrySetCanceled(CancellationToken cancellationToken = default)
if (continuation != null || Interlocked.CompareExchange(ref this.continuation, UniTaskCompletionSourceCoreShared.s_sentinel, null) != null)
{
continuation(continuationState);
return true;
}
return true;
}

return false;
Expand Down

0 comments on commit 8a022ee

Please sign in to comment.