EventWait should not signal the event when it returns Success (#2739)

* Fix race when EventWait is called and a wait is done on the CPU

* This is useless now

* Fix EventSignal

* Ensure the signal belongs to the current fence, to avoid stale signals
This commit is contained in:
gdkchan 2021-10-19 17:25:32 -03:00 committed by GitHub
parent 63f1663fa9
commit 0d174cbd45
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 35 additions and 35 deletions

View file

@ -70,7 +70,7 @@ namespace Ryujinx.Graphics.Gpu.Synchronization
/// <param name="callback">The callback to call when the threshold is reached</param>
/// <exception cref="System.ArgumentOutOfRangeException">Thrown when id >= MaxHardwareSyncpoints</exception>
/// <returns>The created SyncpointWaiterHandle object or null if already past threshold</returns>
public SyncpointWaiterHandle RegisterCallbackOnSyncpoint(uint id, uint threshold, Action callback)
public SyncpointWaiterHandle RegisterCallbackOnSyncpoint(uint id, uint threshold, Action<SyncpointWaiterHandle> callback)
{
if (id >= MaxHardwareSyncpoints)
{
@ -120,7 +120,7 @@ namespace Ryujinx.Graphics.Gpu.Synchronization
using (ManualResetEvent waitEvent = new ManualResetEvent(false))
{
var info = _syncpoints[id].RegisterCallback(threshold, () => waitEvent.Set());
var info = _syncpoints[id].RegisterCallback(threshold, (x) => waitEvent.Set());
if (info == null)
{