From 0aa270172040f5124d119094ed9cd2e5487ea59a Mon Sep 17 00:00:00 2001 From: Jerome Laban Date: Tue, 17 Sep 2024 10:37:41 -0400 Subject: [PATCH] chore: Adjust for threading --- .../Interop/WebAssembly.Runtime.cs | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/Uno.Foundation.Runtime.WebAssembly/Interop/WebAssembly.Runtime.cs b/src/Uno.Foundation.Runtime.WebAssembly/Interop/WebAssembly.Runtime.cs index aee2aceba0d2..14200950202d 100644 --- a/src/Uno.Foundation.Runtime.WebAssembly/Interop/WebAssembly.Runtime.cs +++ b/src/Uno.Foundation.Runtime.WebAssembly/Interop/WebAssembly.Runtime.cs @@ -26,14 +26,17 @@ namespace JSInterop { internal static class InternalCalls { - // Uno-Specific implementation for https://github.com/dotnet/runtime/issues/69409. - // To be removed when the runtime will support the main SynchronizationContext. - // [MethodImplAttribute(MethodImplOptions.InternalCall)] +#if NET9_0_OR_GREATER public static void InvokeOnMainThread() { - Console.WriteLine("invoking InvokeOnMainThread"); - throw new Exception("InvokeOnMainThread not supported"); + throw new NotSupportedException($"Uno Platform net9.0 does not support threading yet."); } +#else + // Uno-Specific implementation for https://github.com/dotnet/runtime/issues/69409. + // To be removed when the runtime will support the main SynchronizationContext. + [MethodImplAttribute(MethodImplOptions.InternalCall)] + public static extern void InvokeOnMainThread(); +#endif } } }