Skip to content
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

Allow GIL state debugging; require GILState to be properly disposed #1397

Merged
merged 1 commit into from Mar 10, 2021

Conversation

lostmsu
Copy link
Member

@lostmsu lostmsu commented Feb 24, 2021

What does this implement/fix? Explain your changes.

PyGILState_Release must always be called from the same thread, that called PyGILState_Acquire. Which means it is illegal to try to dispose GILState from .NET finalizer thread.

See the following thread #1389 (comment)

@filmor
Copy link
Member

filmor commented Mar 10, 2021

Is there any particular reason why we shouldn't just do this unconditionally?

@lostmsu
Copy link
Member Author

lostmsu commented Mar 10, 2021

I am concerned about performance. Once we get perf tests back online, I'd compare.

@lostmsu lostmsu merged commit 1e5338f into pythonnet:master Mar 10, 2021
@lostmsu lostmsu deleted the GIL-Threading branch March 10, 2021 21:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants