HLE: Run Play Report event handlers in a dedicated .NET thread

This commit is contained in:
Evan Husted
2025-02-03 17:01:44 -06:00
parent a0edc5c2b0
commit 5ab50680b4
5 changed files with 141 additions and 127 deletions

View File

@@ -2,14 +2,21 @@ using MsgPack;
using Ryujinx.Horizon.Common;
using Ryujinx.Memory;
using System;
using System.Threading;
namespace Ryujinx.Horizon
{
public static class HorizonStatic
{
internal static void HandlePlayReport(MessagePackObject report) => PlayReportPrinted?.Invoke(report);
internal static void HandlePlayReport(MessagePackObject report) =>
new Thread(() => PlayReport?.Invoke(report))
{
Name = "HLE.PlayReportEvent",
IsBackground = true,
Priority = ThreadPriority.AboveNormal
}.Start();
public static event Action<MessagePackObject> PlayReportPrinted;
public static event Action<MessagePackObject> PlayReport;
[ThreadStatic]
private static HorizonOptions _options;