Fix thread safety

This commit is contained in:
Dean Herbert 2020-06-15 22:19:02 +09:00
parent 2a6faf6a8e
commit d2155c3da3

View File

@ -64,10 +64,12 @@ namespace osu.Game.Updater
if (!CanCheckForUpdate) if (!CanCheckForUpdate)
return; return;
lock (updateTaskLock) Task waitTask;
updateCheckTask ??= PerformUpdateCheck();
await updateCheckTask; lock (updateTaskLock)
waitTask = (updateCheckTask ??= PerformUpdateCheck());
await waitTask;
lock (updateTaskLock) lock (updateTaskLock)
updateCheckTask = null; updateCheckTask = null;