-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Remove try from at-time and close compile timer during throw #39133
Merged
KristofferC
merged 3 commits into
JuliaLang:master
from
IanButterworth:ib/time_remove_try
Jan 7, 2021
Merged
Remove try from at-time and close compile timer during throw #39133
KristofferC
merged 3 commits into
JuliaLang:master
from
IanButterworth:ib/time_remove_try
Jan 7, 2021
Conversation
This file contains 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
JeffBezanson
reviewed
Jan 7, 2021
|
I think you could use something like: macro try_finally(ex, fin)
Expr(:tryfinally,
:(local val = $(esc(ex))),
:($(esc(fin)))
)
end julia> @try_finally x = 3 println("finalizing")
finalizing
3
julia> x
3
julia> @try_finally error() println("finalizing")
finalizing
ERROR:
Stacktrace:
[1] error() at ./error.jl:42
[2] top-level scope at REPL[4]:1 but this probably works as well. |
That's neat.. @JeffBezanson what would be better? |
I'll merge this to get CI working properly again, and then we can discuss the exact implementation (using |
Great, thanks. I'll prepare a PR for the alternative idea |
KristofferC
pushed a commit
that referenced
this pull request
Jan 7, 2021
* remove try from at-time and close compile timer during throw * add scope tests for at-time and aat-timev (cherry picked from commit 03957db)
vtjnash
referenced
this pull request
Jan 7, 2021
KristofferC
pushed a commit
that referenced
this pull request
Jan 8, 2021
* remove try from at-time and close compile timer during throw * add scope tests for at-time and aat-timev (cherry picked from commit 03957db)
staticfloat
pushed a commit
that referenced
this pull request
Jan 15, 2021
* remove try from at-time and close compile timer during throw * add scope tests for at-time and aat-timev (cherry picked from commit 03957db)
ElOceanografo
pushed a commit
to ElOceanografo/julia
that referenced
this pull request
May 4, 2021
…ng#39133) * remove try from at-time and close compile timer during throw * add scope tests for at-time and aat-timev
This was referenced Aug 18, 2021
staticfloat
pushed a commit
that referenced
this pull request
Dec 23, 2022
* remove try from at-time and close compile timer during throw * add scope tests for at-time and aat-timev (cherry picked from commit 03957db)
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.
#38915 accidentally swallowed assignments due to the try-finally scope
this removes the try and disables the timer during every
throw
And maintains the thread-locality introduced in #38915
cc. @vtjnash @ericphanson