mirror of https://github.com/ppy/osu
Explain purpose of `Schedule` call in `MultiplayerPlayer.onResultsReady`
This commit is contained in:
parent
45d537ef72
commit
2d135e5be6
|
@ -175,10 +175,12 @@ private void onMatchStarted() => Scheduler.Add(() =>
|
|||
base.StartGameplay();
|
||||
});
|
||||
|
||||
private void onResultsReady() => Scheduler.Add(() =>
|
||||
private void onResultsReady()
|
||||
{
|
||||
resultsReady.SetResult(true);
|
||||
});
|
||||
// Schedule is required to ensure that `TaskCompletionSource.SetResult` is not called more than once.
|
||||
// A scenario where this can occur is if this instance is not immediately disposed (ie. async disposal queue).
|
||||
Schedule(() => resultsReady.SetResult(true));
|
||||
}
|
||||
|
||||
protected override async Task PrepareScoreForResultsAsync(Score score)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue