Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Add tests for thread interrupt in finally blocks#15187

Merged
kouvel merged 2 commits intodotnet:masterfrom
kouvel:InterruptInFinallyFx
Jan 17, 2017
Merged

Add tests for thread interrupt in finally blocks#15187
kouvel merged 2 commits intodotnet:masterfrom
kouvel:InterruptInFinallyFx

Conversation

@kouvel
Copy link

@kouvel kouvel commented Jan 14, 2017

Related to dotnet/coreclr#8953

@kouvel
Copy link
Author

kouvel commented Jan 14, 2017

Needs CoreCLR PR to be merged and packages updated before this can be merged.

@jkotas @gkhanna79

// does not allow thread interrupt in a finally block. There is nothing special about thread interrupt that requires
// not allowing it in finally blocks, so this behavior has changed in .NET Core.
var continueThread = new AutoResetEvent(false);
Action waitForThread;
Copy link
Member

Choose a reason for hiding this comment

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

Nit: var => Thread

Copy link
Author

Choose a reason for hiding this comment

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

Done

@jkotas
Copy link
Member

jkotas commented Jan 14, 2017

@kouvel Could you please resolve the merge conflict? I have just merged CoreCLR update so this should pass now.

@kouvel
Copy link
Author

kouvel commented Jan 15, 2017

It looks like it hasn't picked up the updated CoreCLR yet, the test is passing against latest CoreCLR locally but failing with the CoreCLR package CoreFX is currently using

@kouvel
Copy link
Author

kouvel commented Jan 15, 2017

@dotnet-bot test this please

@JonHanna
Copy link
Contributor

Is there a good alternative method to guard an section against a thread abort?

@kouvel
Copy link
Author

kouvel commented Jan 15, 2017

Thread abort is not supported by .NET Core

@jkotas
Copy link
Member

jkotas commented Jan 16, 2017

Is there a good alternative method to guard an section against a thread abort?

Wrapping the code by finally block still works fine for runtimes that support thread abort. It is no-op for .NET Core.

@stephentoub
Copy link
Member

@dotnet-bot test this please (now that #15219 has been fixed)

@kouvel kouvel merged commit ebad9db into dotnet:master Jan 17, 2017
@kouvel kouvel deleted the InterruptInFinallyFx branch January 17, 2017 18:53
@karelz karelz modified the milestone: 2.0.0 Jan 21, 2017
picenka21 pushed a commit to picenka21/runtime that referenced this pull request Feb 18, 2022
Add tests for thread interrupt in finally blocks

Related to dotnet/coreclrdotnet/corefx#8953

Commit migrated from dotnet/corefx@ebad9db
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants