From 340629a5c0a53746ff37a5cf8edf898fdbb275dc Mon Sep 17 00:00:00 2001 From: Joel Dice Date: Tue, 19 Nov 2024 06:02:53 -0700 Subject: [PATCH] [WASI] throw PNSE in `ManualResetEventSlim.Wait` (#109839) Signed-off-by: Joel Dice Co-authored-by: pavelsavara --- .../src/System/Threading/ManualResetEventSlim.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/libraries/System.Private.CoreLib/src/System/Threading/ManualResetEventSlim.cs b/src/libraries/System.Private.CoreLib/src/System/Threading/ManualResetEventSlim.cs index a9b8c10c03318..41330649af163 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Threading/ManualResetEventSlim.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Threading/ManualResetEventSlim.cs @@ -489,6 +489,9 @@ public bool Wait(int millisecondsTimeout, CancellationToken cancellationToken) ArgumentOutOfRangeException.ThrowIfLessThan(millisecondsTimeout, -1); +#if TARGET_WASI + if (OperatingSystem.IsWasi()) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185 +#endif #if FEATURE_WASM_MANAGED_THREADS Thread.AssureBlockingPossible(); #endif