Skip to content

make release-gil! exception safe #65

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

Merged
merged 1 commit into from
Jan 26, 2020

Conversation

fonghou
Copy link
Contributor

@fonghou fonghou commented Jan 26, 2020

Since set-gil-thread-id! throws if CAS fails, this patch makes release-gil! exception safe by moving native call before it.

I only had one set-gil-thread-id! throwing CAS failure, so might not be worth it to spin on CAS failure, but at least shouldn't leave GIL in the bad state.

@cnuernber
Copy link
Collaborator

Great catch. I think also the thread Id tracker maybe isnt worth it if the GIL is reentrant.

@cnuernber cnuernber merged commit de2af0f into clj-python:master Jan 26, 2020
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.

2 participants