mirror of
https://github.com/ppy/osu
synced 2025-02-06 13:22:14 +00:00
Run user list copy inline if possible
`getRoomUsers()` was not safe to call from the update thread, as evidenced by the test failures. This was due to the fact that the added reset event could never actually be set from within the method, as the wait was blocking the scheduled set from ever proceeding. Resolve by allowing the scheduled copy & set to run inline if on the update thread already.
This commit is contained in:
parent
5ce5b6cec0
commit
dae27fefe4
@ -380,12 +380,12 @@ namespace osu.Game.Online.Multiplayer
|
||||
|
||||
// at some point we probably want to replace all these schedule calls with Room.LockForUpdate.
|
||||
// for now, as this would require quite some consideration due to the number of accesses to the room instance,
|
||||
// let's just to a schedule for the non-scheduled usages instead.
|
||||
Schedule(() =>
|
||||
// let's just add a manual schedule for the non-scheduled usages instead.
|
||||
Scheduler.Add(() =>
|
||||
{
|
||||
users = Room?.Users.ToList();
|
||||
resetEvent.Set();
|
||||
});
|
||||
}, false);
|
||||
|
||||
resetEvent.Wait(100);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user