Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[wasm] Mark System.Threading APIs as unsupported on Browser #41888

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

using System.Runtime.Versioning;

namespace System.Threading
{
[UnsupportedOSPlatform("browser")]
public sealed class AutoResetEvent : EventWaitHandle
{
public AutoResetEvent(bool initialState) : base(initialState, EventResetMode.AutoReset) { }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

namespace System.Threading
{
[UnsupportedOSPlatform("browser")]
public partial class EventWaitHandle : WaitHandle
{
public EventWaitHandle(bool initialState, EventResetMode mode) :
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

using System.Runtime.Versioning;

namespace System.Threading
{
[UnsupportedOSPlatform("browser")]
public sealed class ManualResetEvent : EventWaitHandle
{
public ManualResetEvent(bool initialState) : base(initialState, EventResetMode.ManualReset) { }
Expand Down
1 change: 1 addition & 0 deletions src/libraries/System.Threading/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@
<Import Project="..\Directory.Build.props" />
<PropertyGroup>
<StrongNameKeyId>Microsoft</StrongNameKeyId>
<IncludePlatformAttributes>true</IncludePlatformAttributes>
</PropertyGroup>
</Project>
3 changes: 3 additions & 0 deletions src/libraries/System.Threading/ref/System.Threading.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ public AsyncLocal(System.Action<System.Threading.AsyncLocalValueChangedArgs<T>>?
[System.Diagnostics.CodeAnalysis.MaybeNullAttribute]
public T Value { get { throw null; } set { } }
}
[System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")]
public sealed partial class AutoResetEvent : System.Threading.EventWaitHandle
{
public AutoResetEvent(bool initialState) : base (default(bool), default(System.Threading.EventResetMode)) { }
Expand Down Expand Up @@ -108,6 +109,7 @@ public enum EventResetMode
AutoReset = 0,
ManualReset = 1,
}
[System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")]
public partial class EventWaitHandle : System.Threading.WaitHandle
{
public EventWaitHandle(bool initialState, System.Threading.EventResetMode mode) { }
Expand Down Expand Up @@ -242,6 +244,7 @@ public enum LockRecursionPolicy
NoRecursion = 0,
SupportsRecursion = 1,
}
[System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")]
public sealed partial class ManualResetEvent : System.Threading.EventWaitHandle
{
public ManualResetEvent(bool initialState) : base (default(bool), default(System.Threading.EventResetMode)) { }
Expand Down