Blocks should be synchronized on read-only fields (#5212)

* Blocks should be synchronized on read-only fields

* more readonlys

* fix alignment

* more

* Update ISelfController.cs

* simplify new

* simplify new
This commit is contained in:
Marco Carvalho 2023-06-14 21:34:55 -03:00 committed by GitHub
parent f978d3726a
commit 82f90704a0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
45 changed files with 60 additions and 68 deletions

View file

@ -34,7 +34,7 @@ namespace Ryujinx.HLE.HOS.Services.SurfaceFlinger
public bool EnableExternalEvent;
public int MaxBufferCountCached;
public readonly object Lock = new object();
public readonly object Lock = new();
private KEvent _waitBufferFreeEvent;
private KEvent _frameAvailableEvent;

View file

@ -21,7 +21,7 @@ namespace Ryujinx.HLE.HOS.Services.SurfaceFlinger
private uint _currentCallbackTicket;
private uint _callbackTicket;
private readonly object _callbackLock = new object();
private readonly object _callbackLock = new();
public BufferQueueProducer(BufferQueueCore core, ITickSource tickSource)
{

View file

@ -23,7 +23,7 @@ namespace Ryujinx.HLE.HOS.Services.SurfaceFlinger
protected BufferQueueConsumer Consumer;
protected readonly object Lock = new object();
protected readonly object Lock = new();
private IConsumerListener _listener;
@ -168,7 +168,7 @@ namespace Ryujinx.HLE.HOS.Services.SurfaceFlinger
Slot slot = Slots[slotIndex];
// TODO: Check this. On Android, this checks the "handle". I assume NvMapHandle is the handle, but it might not be.
// TODO: Check this. On Android, this checks the "handle". I assume NvMapHandle is the handle, but it might not be.
return !slot.GraphicBuffer.IsNull && slot.GraphicBuffer.Object.Buffer.Surfaces[0].NvMapHandle == graphicBuffer.Object.Buffer.Surfaces[0].NvMapHandle;
}
}

View file

@ -37,7 +37,7 @@ namespace Ryujinx.HLE.HOS.Services.SurfaceFlinger
private int _swapInterval;
private int _swapIntervalDelay;
private readonly object Lock = new object();
private readonly object Lock = new();
public long RenderLayerId { get; private set; }