Skip to content

make release-gil! exception safe#65

Merged
cnuernber merged 1 commit into
clj-python:masterfrom
dukefong8:reentrant-gil
Jan 26, 2020
Merged

make release-gil! exception safe#65
cnuernber merged 1 commit into
clj-python:masterfrom
dukefong8:reentrant-gil

Conversation

@dukefong8

Copy link
Copy Markdown
Contributor

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
Copy Markdown
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