From 0d174cbd4555e69660a900577a52f3d4bf7391b9 Mon Sep 17 00:00:00 2001 From: gdkchan Date: Tue, 19 Oct 2021 17:25:32 -0300 Subject: 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 --- Ryujinx.Graphics.Gpu/Synchronization/Syncpoint.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'Ryujinx.Graphics.Gpu/Synchronization/Syncpoint.cs') diff --git a/Ryujinx.Graphics.Gpu/Synchronization/Syncpoint.cs b/Ryujinx.Graphics.Gpu/Synchronization/Syncpoint.cs index 30f8cc86..39fb83c0 100644 --- a/Ryujinx.Graphics.Gpu/Synchronization/Syncpoint.cs +++ b/Ryujinx.Graphics.Gpu/Synchronization/Syncpoint.cs @@ -34,13 +34,13 @@ namespace Ryujinx.Graphics.Gpu.Synchronization /// The target threshold /// The callback to call when the threshold is reached /// The created SyncpointWaiterHandle object or null if already past threshold - public SyncpointWaiterHandle RegisterCallback(uint threshold, Action callback) + public SyncpointWaiterHandle RegisterCallback(uint threshold, Action callback) { lock (_waiters) { if (Value >= threshold) { - callback(); + callback(null); return null; } @@ -111,13 +111,13 @@ namespace Ryujinx.Graphics.Gpu.Synchronization // we can't call it inside the lock. if (expired != null) { - expired.Callback(); + expired.Callback(expired); if (expiredList != null) { for (int i = 0; i < expiredList.Count; i++) { - expiredList[i].Callback(); + expiredList[i].Callback(expiredList[i]); } } } -- cgit v1.2.3