Skip to content

[wasm] Mark System.Threading.Thread APIs unsupported on Browser - #41892

Closed
mdh1418 wants to merge 4 commits into
dotnet:masterfrom
mdh1418:mdhwang/system_threading_thread_unsupported
Closed

mdh1418 wants to merge 4 commits into
dotnet:masterfrom
mdh1418:mdhwang/system_threading_thread_unsupported

Conversation

@mdh1418

@mdh1418 mdh1418 commented Sep 4, 2020

Copy link
Copy Markdown
Member

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

ghost commented Sep 4, 2020

Copy link
Copy Markdown

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

@MaximLipnin MaximLipnin mentioned this pull request Sep 4, 2020
71 tasks done
}

[UnsupportedOSPlatform("browser")]
public static void ResetAbort()

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Contributor

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

mdh1418 commented Sep 7, 2020 •

Copy link
Copy Markdown
Member Author

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