[issue37878] Sub-Interpreters : Document PyThreadState_DeleteCurrent()

Joannah Nanjekye report at bugs.python.org
Mon Aug 19 11:31:01 EDT 2019


Joannah Nanjekye <nanjekyejoannah at gmail.com> added the comment:

>From what I know the GIL is released by calling PyEval_ReleaseThread() or PyEval_SaveThread(). 

I see we can use PyThreadState_Delete() to clean up-specifically destroy thread state but does not release the GIL and requires a thread state. On the other hand, PyThreadState_DeleteCurrent() allows to both clean up the current thread state - no thread state is required as well release the GIL which is convenient. I would not fight so much to keep it public given we have PyEval_ReleaseThread() or PyEval_SaveThread().

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue37878>
_______________________________________


More information about the Python-bugs-list mailing list