Skip to content

bpo-36854: Clear the current thread later #17279

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
Nov 20, 2019
Merged

bpo-36854: Clear the current thread later #17279

merged 1 commit into from
Nov 20, 2019

Conversation

vstinner
Copy link
Member

@vstinner vstinner commented Nov 20, 2019

Clear the current thread later in the Python finalization.

  • The PyInterpreterState_Delete() function is now responsible
    to call PyThreadState_Swap(NULL).
  • The tstate_delete_common() function is now responsible to clear the
    "autoTSSKey" thread local storage and it only clears it once the
    thread state is fully cleared. It allows to still get the current
    thread from TSS in tstate_delete_common().

https://bugs.python.org/issue36854

Clear the current thread later in the Python finalization.

* The PyInterpreterState_Delete() function is now responsible
  to call PyThreadState_Swap(NULL).
* The tstate_delete_common() function is now responsible to clear the
  "autoTSSKey" thread local storage and it only clears it once the
  thread state is fully cleared. It allows to still get the current
  thread from TSS in tstate_delete_common().
@vstinner vstinner merged commit 9da7430 into python:master Nov 20, 2019
@vstinner vstinner deleted the delete_tstate branch November 20, 2019 10:17
jacobneiltaylor pushed a commit to jacobneiltaylor/cpython that referenced this pull request Dec 5, 2019
Clear the current thread later in the Python finalization.

* The PyInterpreterState_Delete() function is now responsible
  to call PyThreadState_Swap(NULL).
* The tstate_delete_common() function is now responsible to clear the
  "autoTSSKey" thread local storage and it only clears it once the
  thread state is fully cleared. It allows to still get the current
  thread from TSS in tstate_delete_common().
shihai1991 pushed a commit to shihai1991/cpython that referenced this pull request Jan 31, 2020
Clear the current thread later in the Python finalization.

* The PyInterpreterState_Delete() function is now responsible
  to call PyThreadState_Swap(NULL).
* The tstate_delete_common() function is now responsible to clear the
  "autoTSSKey" thread local storage and it only clears it once the
  thread state is fully cleared. It allows to still get the current
  thread from TSS in tstate_delete_common().
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants