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.Thread APIs unsupported on Browser #41892

Conversation

mdh1418
Copy link
Member

@mdh1418 mdh1418 commented Sep 4, 2020

Contributes to #41087

M:System.Threading.Thread.Abort(System.Object),System.Threading,Thread,Abort(Object),0
M:System.Threading.Thread.ResetAbort,System.Threading,Thread,ResetAbort(),0
M:System.Threading.Thread.get_CurrentPrincipal,System.Threading,Thread,get_CurrentPrincipal(),1
M:System.Threading.Thread.Suspend,System.Threading,Thread,Suspend(),0
M:System.Threading.Thread.SetApartmentState(System.Threading.ApartmentState),System.Threading,Thread,SetApartmentState(ApartmentState),0
M:System.Threading.Thread.Abort,System.Threading,Thread,Abort(),0
M:System.Threading.Thread.Resume,System.Threading,Thread,Resume(),0
"M:System.Threading.CompressedStack.GetObjectData(System.Runtime.Serialization.SerializationInfo,System.Runtime.Serialization.StreamingContext)",System.Threading,CompressedStack,"GetObjectData(SerializationInfo, StreamingContext)",0

Omitted CompressedStack because it pertains to Serialization infrastructure.
SetApartmentState is windows specific
Abort, Suspend, Resume are obsolete

@ghost
Copy link

ghost commented Sep 4, 2020

Tagging subscribers to this area: @safern, @ViktorHofer
See info in area-owners.md if you want to be subscribed.

@@ -189,6 +190,7 @@ public void Abort(object? stateInfo)
throw new PlatformNotSupportedException(SR.PlatformNotSupported_ThreadAbort);
}

[UnsupportedOSPlatform("browser")]
public static void ResetAbort()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

since this throws PNSE everywhere, is there a way we can mark it as such?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if its better to stick with the convention of marking it Obsolete. I wasn't sure if a docs issue should be linked in the parameters of Obsolete. It looks like it was brought up in dotnet/docs#3825.

Another option that was brought up was to mark this as [UnsupportedOSPlatform("none")]

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jeffhandley @buyaa-n What do y'all think about [UnsupportedOSPlatform("none")]?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the analyzer that would be treated like unsupported on a platform named "none", there is no generic naming for all platforms CC @terrajobst

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Obsolete] would be a better approach than to fake that with an [UnsupportedOSPlatform] or [SupportedOSPlatform] attribute. I recommend we omit this annotation here and file a 6.0.0 issue to mark this API as Obsolete.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was looking at a stale page a moment ago. I think we'll have to wait to mark this as Obsolete until 6.0.0 since it's technically a breaking change. We'll want to consider using a custom diagnostic id for the obsoletion too and add it to the list of obsoletions, etc.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with Jeff. We shouldn't annotate this API. We should obsolete, but not for .NET 5.

@mdh1418
Copy link
Member Author

mdh1418 commented Sep 7, 2020

Besides ResetAbort, which now has an issue #41925 to be marked as obsolete for 6.0.0, all the other APIs are either windows specific, obsolete, or related to the serialization infrastructure. Closing this PR as it makes no changes.

@mdh1418 mdh1418 closed this Sep 7, 2020
@mdh1418 mdh1418 deleted the mdhwang/system_threading_thread_unsupported branch September 7, 2020 01:02
@ghost ghost locked as resolved and limited conversation to collaborators Dec 7, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
arch-wasm WebAssembly architecture area-System.Threading
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants