Skip to content

bpo-40226: PyInterpreterState_Delete() deletes pending calls #19436

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
Apr 8, 2020
Merged

bpo-40226: PyInterpreterState_Delete() deletes pending calls #19436

merged 1 commit into from
Apr 8, 2020

Conversation

vstinner
Copy link
Member

@vstinner vstinner commented Apr 8, 2020

PyInterpreterState_New() is now responsible to create pending calls,
PyInterpreterState_Delete() now deletes pending calls.

  • Rename _PyEval_InitThreads() to _PyEval_InitGIL() and rename
    _PyEval_InitGIL() to _PyEval_FiniGIL().
  • _PyEval_InitState() and PyEval_FiniState() now create and delete
    pending calls. _PyEval_InitState() now returns -1 on memory
    allocation failure.
  • Add init_interp_create_gil() helper function: code shared by
    Py_NewInterpreter() and Py_InitializeFromConfig().
  • init_interp_create_gil() now also calls _PyEval_FiniGIL(),
    _PyEval_InitGIL() and _PyGILState_Init() in subinterpreters, but
    these functions now do nothing when called from a subinterpreter.

https://bugs.python.org/issue40226

PyInterpreterState_New() is now responsible to create pending calls,
PyInterpreterState_Delete() now deletes pending calls.

* Rename _PyEval_InitThreads() to _PyEval_InitGIL() and rename
  _PyEval_InitGIL() to _PyEval_FiniGIL().
* _PyEval_InitState() and PyEval_FiniState() now create and delete
  pending calls. _PyEval_InitState() now returns -1 on memory
  allocation failure.
* Add init_interp_create_gil() helper function: code shared by
  Py_NewInterpreter() and Py_InitializeFromConfig().
* init_interp_create_gil() now also calls _PyEval_FiniGIL(),
  _PyEval_InitGIL() and _PyGILState_Init() in subinterpreters, but
  these functions now do nothing when called from a subinterpreter.
@vstinner
Copy link
Member Author

vstinner commented Apr 8, 2020

I tested manually: this PR fix https://bugs.python.org/issue40226

@vstinner vstinner merged commit dda5d6e into python:master Apr 8, 2020
@vstinner vstinner deleted the fini_pending_calls branch April 8, 2020 15:55
@zhanpon zhanpon mentioned this pull request Aug 9, 2022
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