From 57d3296ba4e5c1fc7ca30376c7ca8eb3041ae2f6 Mon Sep 17 00:00:00 2001 From: Mary Date: Sun, 28 Nov 2021 21:24:17 +0100 Subject: infra: Migrate to .NET 6 (#2829) * infra: Migrate to .NET 6 * Rollback version naming change * Workaround .NET 6 ZipArchive API issues * ci: Switch to VS 2022 for AppVeyor CI is now ready for .NET 6 * Suppress WebClient warning in DoUpdateWithMultipleThreads * Attempt to workaround System.Drawing.Common changes on 6.0.0 * Change keyboard rendering from System.Drawing to ImageSharp * Make the software keyboard renderer multithreaded * Bump ImageSharp version to 1.0.4 to fix a bug in Image.Load * Add fallback fonts to the keyboard renderer * Fix warnings * Address caian's comment * Clean up linux workaround as it's uneeded now * Update readme Co-authored-by: Caian Benedicto --- Ryujinx.HLE/HOS/Applets/SoftwareKeyboard/TimedAction.cs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'Ryujinx.HLE/HOS/Applets/SoftwareKeyboard/TimedAction.cs') diff --git a/Ryujinx.HLE/HOS/Applets/SoftwareKeyboard/TimedAction.cs b/Ryujinx.HLE/HOS/Applets/SoftwareKeyboard/TimedAction.cs index 8884bdcf..0de78a0e 100644 --- a/Ryujinx.HLE/HOS/Applets/SoftwareKeyboard/TimedAction.cs +++ b/Ryujinx.HLE/HOS/Applets/SoftwareKeyboard/TimedAction.cs @@ -144,6 +144,20 @@ namespace Ryujinx.HLE.HOS.Applets.SoftwareKeyboard }), cancelled); } + public void Reset(Action action) + { + // Create a dedicated cancel token for each task. + var cancelled = new TRef(false); + + Reset(new Thread(() => + { + while (!Volatile.Read(ref cancelled.Value)) + { + action(); + } + }), cancelled); + } + private static bool SleepWithSubstep(SleepSubstepData substepData, TRef cancelled) { for (int i = 0; i < substepData.SleepCount; i++) -- cgit v1.2.3