Skip to content
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

bpo-39984: trip_signal() uses PyGILState_GetThisThreadState() #19061

Merged
merged 1 commit into from
Mar 18, 2020
Merged

bpo-39984: trip_signal() uses PyGILState_GetThisThreadState() #19061

merged 1 commit into from
Mar 18, 2020

Conversation

vstinner
Copy link
Member

@vstinner vstinner commented Mar 18, 2020

bpo-37127, bpo-39984:

  • trip_signal() and Py_AddPendingCall() now get the current Python
    thread state using PyGILState_GetThisThreadState() rather than
    _PyRuntimeState_GetThreadState() to be able to get it even if the
    GIL is released.
  • _PyEval_SignalReceived() now expects tstate rather than ceval.
  • Remove ceval parameter of _PyEval_AddPendingCall(): ceval is now
    get from tstate parameter.

https://bugs.python.org/issue39984

bpo-37127, bpo-39984:

* trip_signal() and Py_AddPendingCall() now get the current Python
  thread state using PyGILState_GetThisThreadState() rather than
  _PyRuntimeState_GetThreadState() to be able to get it even if the
  GIL is released.
* _PyEval_SignalReceived() now expects tstate rather than ceval.
* Remove ceval parameter of _PyEval_AddPendingCall(): ceval is now
  get from tstate parameter.
@vstinner
Copy link
Member Author

Py_AddPendingCall() and trip_signal() have an issue if the thread has no Python thread state. But this PR doesn't make the situation better or worse, the problem already existed before. See: https://bugs.python.org/issue37127#msg364543

@vstinner vstinner merged commit 8849e59 into python:master Mar 18, 2020
@vstinner vstinner deleted the pending_tstate branch March 18, 2020 18:29
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