mirror of
https://github.com/ppy/osu.git
synced 2024-11-11 13:37:25 +08:00
Merge branch 'master' into fix-perform-from-menu-nullref
This commit is contained in:
commit
1b1447eb35
@ -5,9 +5,7 @@
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading;
|
||||
using Newtonsoft.Json;
|
||||
using osu.Framework.Allocation;
|
||||
|
||||
namespace osu.Game.Online.Multiplayer
|
||||
{
|
||||
@ -48,27 +46,6 @@ namespace osu.Game.Online.Multiplayer
|
||||
RoomID = roomId;
|
||||
}
|
||||
|
||||
private object updateLock = new object();
|
||||
|
||||
private ManualResetEventSlim freeForWrite = new ManualResetEventSlim(true);
|
||||
|
||||
/// <summary>
|
||||
/// Request a lock on this room to perform a thread-safe update.
|
||||
/// </summary>
|
||||
public IDisposable LockForUpdate()
|
||||
{
|
||||
// ReSharper disable once InconsistentlySynchronizedField
|
||||
freeForWrite.Wait();
|
||||
|
||||
lock (updateLock)
|
||||
{
|
||||
freeForWrite.Wait();
|
||||
freeForWrite.Reset();
|
||||
|
||||
return new ValueInvokeOnDisposal<MultiplayerRoom>(this, r => freeForWrite.Set());
|
||||
}
|
||||
}
|
||||
|
||||
public override string ToString() => $"RoomID:{RoomID} Host:{Host?.UserID} Users:{Users.Count} State:{State} Settings: [{Settings}]";
|
||||
}
|
||||
}
|
||||
|
@ -7,12 +7,11 @@ namespace osu.Game.Overlays.Changelog
|
||||
{
|
||||
public class ChangelogUpdateStreamControl : OverlayStreamControl<APIUpdateStream>
|
||||
{
|
||||
protected override OverlayStreamItem<APIUpdateStream> CreateStreamItem(APIUpdateStream value) => new ChangelogUpdateStreamItem(value);
|
||||
|
||||
protected override void LoadComplete()
|
||||
public ChangelogUpdateStreamControl()
|
||||
{
|
||||
// suppress base logic of immediately selecting first item if one exists
|
||||
// (we always want to start with no stream selected).
|
||||
SelectFirstTabByDefault = false;
|
||||
}
|
||||
|
||||
protected override OverlayStreamItem<APIUpdateStream> CreateStreamItem(APIUpdateStream value) => new ChangelogUpdateStreamItem(value);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user