mirror of
https://github.com/osukey/osukey.git
synced 2025-07-02 08:49:59 +09:00
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:
@ -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;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user