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-40082: trip_signal() uses the main interpreter #19441

Merged
merged 1 commit into from Apr 8, 2020
Merged

bpo-40082: trip_signal() uses the main interpreter #19441

merged 1 commit into from Apr 8, 2020

Conversation

vstinner
Copy link
Member

@vstinner vstinner commented Apr 8, 2020

Fix the signal handler: it now always uses the main interpreter,
rather than trying to get the current Python thread state.

The following function now accepts an interpreter, instead of a
Python thread state:

  • _PyEval_SignalReceived()
  • _Py_ThreadCanHandleSignals()
  • _PyEval_AddPendingCall()
  • COMPUTE_EVAL_BREAKER()
  • SET_GIL_DROP_REQUEST(), RESET_GIL_DROP_REQUEST()
  • SIGNAL_PENDING_CALLS(), UNSIGNAL_PENDING_CALLS()
  • SIGNAL_PENDING_SIGNALS(), UNSIGNAL_PENDING_SIGNALS()
  • SIGNAL_ASYNC_EXC(), UNSIGNAL_ASYNC_EXC()

Py_AddPendingCall() now uses the main interpreter if it fails to the
current Python thread state.

Convert _PyThreadState_GET() and PyInterpreterState_GET_UNSAFE()
macros to static inline functions.

https://bugs.python.org/issue40082

Fix the signal handler: it now always uses the main interpreter,
rather than trying to get the current Python thread state.

The following function now accepts an interpreter, instead of a
Python thread state:

* _PyEval_SignalReceived()
* _Py_ThreadCanHandleSignals()
* _PyEval_AddPendingCall()
* COMPUTE_EVAL_BREAKER()
* SET_GIL_DROP_REQUEST(), RESET_GIL_DROP_REQUEST()
* SIGNAL_PENDING_CALLS(), UNSIGNAL_PENDING_CALLS()
* SIGNAL_PENDING_SIGNALS(), UNSIGNAL_PENDING_SIGNALS()
* SIGNAL_ASYNC_EXC(), UNSIGNAL_ASYNC_EXC()

Py_AddPendingCall() now uses the main interpreter if it fails to the
current Python thread state.

Convert _PyThreadState_GET() and PyInterpreterState_GET_UNSAFE()
macros to static inline functions.
@vstinner vstinner merged commit b54a99d into python:master Apr 8, 2020
@vstinner vstinner deleted the trip_signal_interp branch April 8, 2020 21:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants