rjx-mirror/src/Ryujinx.Ava
jhorv 42b9c1e8fe
Ryujinx.Ava: fixes for random hangs on exit (#4827)
* Attempt at fixing hang on exit by ending the WindowNotificationManager notification loop, so that the Thread running it can exit.

* explicitly apply the NotificationManager template to allow the notification loop to begin

* NotificationHelper - remove explicity call to ApplyTemplate(). Change to ManualResetEventSlim so we can cancel the Wait on it.

* add a timeout to AudioRenderSystem.Stop()'s waiting for the termination signal, log a warning if this timeout occurs, and continue execution

* NotifiationHelper - cancel first, the CompleteAdding()

* Remove AudioRenderSystem._terminationEvent, redundant

* NotificationHelper - use host.Closing event to trigger cancellation instead of _notifationManager.DetachedFromLogicalTree

* Change NotificationHelper to use an explicit Thread for background work.  Wait on the cancellationToken's WaitHandle so the Thread doesn't have to deal with async. Wrap foreach in try/catch (OperationCanceledException) to swallow the escaping exception from the GetConsumingEnumerable().

* adjust formatting of AsyncWorkQueue constructor to use object initializers consistently

* use AsyncWorkQueue to do everything I added in SetNotificationManager()

* Revert "use AsyncWorkQueue to do everything I added in SetNotificationManager()"

This reverts commit f0e78366b8776ec8e2fef8ab023c0db1833155d3.

* use AsyncWorkQueue to handle the Thread-related changes previously made to NotificationHelper.SetNotificationHelper(). Wrap it in Lazy<T> and force instantiation in the TemplateApplied event handler to accomodate for the fact that AsyncWorkQueue starts immediately, and the notification dispatch loop was being delayed by _templateAppliedEvent.

* impl changes suggested by AcK77

* impl changes suggested by AcK77 (more)
2023-05-26 23:57:43 +02:00
..
Assets Ava UI: Input Menu Redesign (#4990) 2023-05-22 01:16:20 +02:00
Common ava: Fix crash when extracting sections from NCA with no data section (#5002) 2023-05-17 19:27:49 +00:00
Input Ava: Fix wrong MouseButton (#4900) 2023-05-12 21:39:42 +02:00
Modules/Updater Fix the restart after an update. (#4869) 2023-05-12 02:14:29 +02:00
UI Ryujinx.Ava: fixes for random hangs on exit (#4827) 2023-05-26 23:57:43 +02:00
App.axaml Move solution and projects to src 2023-04-27 23:51:14 +02:00
App.axaml.cs Move solution and projects to src 2023-04-27 23:51:14 +02:00
AppHost.cs [GUI] Fix always hide cursor mode not hiding the cursor until it was moved (#4927) 2023-05-14 16:34:31 +02:00
Program.cs Add hide-cursor command line argument & always hide cursor option (#4613) 2023-05-02 03:29:47 +02:00
Ryujinx.Ava.csproj UI: Move ApplicationContextMenu in a separated class (#4755) 2023-05-04 14:41:06 +00:00
Ryujinx.ico Move solution and projects to src 2023-04-27 23:51:14 +02:00