Add default interrupt handlers#13568
Merged
straight-shoota merged 4 commits intocrystal-lang:masterfrom Jun 27, 2023
Merged
Conversation
Contributor
|
On Windows this works when run alone: lib LibC
fun GenerateConsoleCtrlEvent(dwCtrlEvent : DWORD, dwProcessGroupId : DWORD) : BOOL
end
at_exit { print "Exiting" }
print "."
STDOUT.flush
LibC.GenerateConsoleCtrlEvent(LibC::CTRL_C_EVENT, 0)
sleepHowever it also sends Ctrl+C to the spec process itself, effectively aborting the spec. |
Member
Author
|
I suppose we could put that in |
Member
Author
|
Even a manual spec needs a functioning spec harness which doesn't work when the process gets cancelled from inside an example. |
HertzDevil
requested changes
Jun 26, 2023
Contributor
HertzDevil
left a comment
There was a problem hiding this comment.
It should be noted that restore_interrupts! does not restore this default interrupt handler (or maybe it should?)
HertzDevil
approved these changes
Jun 26, 2023
straight-shoota
added a commit
that referenced
this pull request
Jul 18, 2023
This reverts commit 742d920.
Member
Author
Blacksmoke16
pushed a commit
to Blacksmoke16/crystal
that referenced
this pull request
Dec 11, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resolves #8687