Make ProgressNotification's status and progress thread-safe

Quite regularly a task will hold a reference to a progress notification and udpate it as progress is made. Therefore these operations should be thread-safe.
This commit is contained in:
Dean Herbert
2017-10-18 10:07:20 +09:00
parent 120d3fbbec
commit 518e5a2245

View File

@ -25,10 +25,7 @@ namespace osu.Game.Overlays.Notifications
public float Progress
{
get { return progressBar.Progress; }
set
{
progressBar.Progress = value;
}
set { Schedule(() => progressBar.Progress = value); }
}
protected override void LoadComplete()
@ -43,6 +40,8 @@ namespace osu.Game.Overlays.Notifications
{
get { return state; }
set
{
Schedule(() =>
{
bool stateChanged = state != value;
state = value;
@ -79,6 +78,7 @@ namespace osu.Game.Overlays.Notifications
break;
}
}
});
}
}