Skip to content

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