Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Grab the GIL on shutdown when checking for exceptions#1832

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

Conversation

BadSingleton
Copy link
Contributor

@BadSingletonBadSingleton commentedJun 23, 2022
edited
Loading

What does this implement/fix? Explain your changes.

The GIL isn't taken when being called from the DomainUnload handler. Take it to avoid a crash when callingExceptions.ErrorOccurred()

Does this close any currently open issues?

#1831

Checklist

Check all those that are applicable and complete.

Martin-Molinero reacted with eyes emoji
The GIL isn't taken when being called from the DomainUnload handler.
@filmorfilmor requested a review fromlostmsuJune 23, 2022 19:41
Comment on lines +361 to +366
var pyGILState = PyGILState.PyGILState_UNLOCKED;
if (!Runtime.HostedInPython)
{
pyGILState = Runtime.PyGILState_Ensure();
}

Copy link
Member

@lostmsulostmsuJun 23, 2022
edited
Loading

Choose a reason for hiding this comment

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

SincePy.GIL() no longer tries to force runtime initialization, I think the code would be easier to read with a simpleusing (Py.GIL()) { ... } around theif.

I don't think it is necessary to check if we are hosted in Python.Runtime.Shutdown further down does not.

Copy link
Member

@lostmsulostmsuJun 24, 2022
edited
Loading

Choose a reason for hiding this comment

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

Another issue is that the code below throws when Python error is set. And thatthrow prevents the GIL release code to be reached making the GIL unreleasable. Would not be a problem withusing Py.GIL

BadSingleton reacted with thumbs up emoji
Copy link
Member

Choose a reason for hiding this comment

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

I'll adjust it accordingly s.t. we can tag rc1.

lostmsu reacted with thumbs up emoji
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@filmorfilmorfilmor left review comments

@lostmsulostmsulostmsu requested changes

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

3 participants
@BadSingleton@filmor@lostmsu

[8]ページ先頭

©2009-2025 Movatter.jp