- Notifications
You must be signed in to change notification settings - Fork5.2k
Implement PosixSignal API#54136
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
ghost commentedJun 14, 2021
Note regarding the This serves as a reminder for when your PR is modifying a ref *.cs file and adding/modifying public APIs, to please make sure the API implementation in the src *.cs file is documented with triple slash comments, so the PR reviewers can sign off that change. |
Uh oh!
There was an error while loading.Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
I've manually added these to theref file, I don't know if there is an automated way.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
The automated way is documented inhttps://github.com/dotnet/runtime/blob/main/docs/coding-guidelines/updating-ref-source.md . It would be a good idea to rerun the automated process to make sure that the formatting is right.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
But beware, it currently removes attributes...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
I ran it and copied in thePosixSignal bits.
I'm surprised to seeinternal instead ofprivate on thePosixSignalRegistration constructor.
src/libraries/System.Runtime.InteropServices/src/System.Runtime.InteropServices.csproj OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
src/libraries/System.Runtime.InteropServices/src/System.Runtime.InteropServices.csproj OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
...ries/System.Runtime.InteropServices/src/System/Runtime/InteropServices/PosixSignalContext.cs OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
...m.Runtime.InteropServices/src/System/Runtime/InteropServices/PosixSignalRegistration.Unix.cs OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
src/libraries/System.Runtime.InteropServices/src/System/Runtime/InteropServices/PosixSignal.cs OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
...m.Runtime.InteropServices/src/System/Runtime/InteropServices/PosixSignalRegistration.Unix.cs OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
...System.Runtime.InteropServices/src/System/Runtime/InteropServices/PosixSignalRegistration.cs OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
...m.Runtime.InteropServices/src/System/Runtime/InteropServices/PosixSignalRegistration.Unix.cs OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
...m.Runtime.InteropServices/src/System/Runtime/InteropServices/PosixSignalRegistration.Unix.cs OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
...m.Runtime.InteropServices/src/System/Runtime/InteropServices/PosixSignalRegistration.Unix.cs OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
src/libraries/Common/src/Interop/Unix/System.Native/Interop.PosixSignal.cs OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
...m.Runtime.InteropServices/src/System/Runtime/InteropServices/PosixSignalRegistration.Unix.cs OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
...m.Runtime.InteropServices/src/System/Runtime/InteropServices/PosixSignalRegistration.Unix.cs OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
...m.Runtime.InteropServices/src/System/Runtime/InteropServices/PosixSignalRegistration.Unix.cs OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
...System.Runtime.InteropServices/src/System/Runtime/InteropServices/PosixSignalRegistration.cs OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
...m.Runtime.InteropServices/src/System/Runtime/InteropServices/PosixSignalRegistration.Unix.cs OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
...m.Runtime.InteropServices/src/System/Runtime/InteropServices/PosixSignalRegistration.Unix.cs OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
...m.Runtime.InteropServices/src/System/Runtime/InteropServices/PosixSignalRegistration.Unix.cs OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
andyleejordan commentedJun 15, 2021
Hey, I just wanted to drop by and say it's really exciting to see this work! 🥳 |
...m.Runtime.InteropServices/src/System/Runtime/InteropServices/PosixSignalRegistration.Unix.cs OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
src/libraries/Common/src/Interop/Unix/System.Native/Interop.PosixSignal.cs OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
src/libraries/Common/src/Interop/Unix/System.Native/Interop.PosixSignal.cs OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
tmds commentedJun 18, 2021
The implementation has changed a bit since the initial PR.
The implementation will call the original It handles specifically what is cancelable by the runtime using
I'll look at writing some tests next week. |
alexrp commentedJun 18, 2021
Just posting here as well so it doesn't get missed: I think it's worth considering a rename to |
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
...m.Runtime.InteropServices/src/System/Runtime/InteropServices/PosixSignalRegistration.Unix.cs OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
lambdageek commentedJun 18, 2021
@tmds what's the expected behavior if users set up a handler for a signal that the runtime uses internally. For example, the mono GC uses signals on non-Apple Unixes to suspend threads that are in preemptive mode - we pick the signal dynamically and use runtime/src/mono/mono/utils/mono-threads-posix-signals.c Lines 48 to 119 inf37f0b9
Should we have some mechanism that the runtime could use to prevent users from installing handlers for these signals? |
tmds commentedJun 21, 2021
By default the original handler gets called.
I don't have a strong opinion if we should forbid certain values. |
...m.Runtime.InteropServices/src/System/Runtime/InteropServices/PosixSignalRegistration.Unix.csShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
...m.Runtime.InteropServices/src/System/Runtime/InteropServices/PosixSignalRegistration.Unix.csShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
...m.Runtime.InteropServices/src/System/Runtime/InteropServices/PosixSignalRegistration.Unix.cs OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
...m.Runtime.InteropServices/src/System/Runtime/InteropServices/PosixSignalRegistration.Unix.csShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
...m.Runtime.InteropServices/src/System/Runtime/InteropServices/PosixSignalRegistration.Unix.csShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
...m.Runtime.InteropServices/src/System/Runtime/InteropServices/PosixSignalRegistration.Unix.csShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
...m.Runtime.InteropServices/src/System/Runtime/InteropServices/PosixSignalRegistration.Unix.cs OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
...m.Runtime.InteropServices/src/System/Runtime/InteropServices/PosixSignalRegistration.Unix.csShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
...m.Runtime.InteropServices/src/System/Runtime/InteropServices/PosixSignalRegistration.Unix.cs OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
Co-authored-by: Stephen Toub <stoub@microsoft.com>
…anceledPosixSignal.
tmds commentedJul 5, 2021
CI fail is unrelated. |
...ries/System.Runtime.InteropServices/src/System/Runtime/InteropServices/PosixSignalContext.cs OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
...ries/System.Runtime.InteropServices/src/System/Runtime/InteropServices/PosixSignalContext.csShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
Co-authored-by: Stephen Toub <stoub@microsoft.com>
stephentoub commentedJul 8, 2021
Thanks! |
Implements#50527.
I still need to add tests.
Can you do a first review of the implementation?
cc@janvorli@jkotas@stephentoub@davidfowl@bartonjs