WIP: bpo-35059: _PyThreadState_GET() checks that the GIL is hold#10278
WIP: bpo-35059: _PyThreadState_GET() checks that the GIL is hold#10278vstinner wants to merge 1 commit into
Conversation
Convert _PyThreadState_GET() and _PyInterpreterState_GET_UNSAFE() macros to static inline functions, and the functions now check that the GIL is hold. Add _PyThreadState_GET_UNSAFE(): similar to _PyThreadState_GET(), but don't check that the GIL is hold.
|
This can hit performance. Could you open issues for such potentially dangerous changes? |
Sorry, something went wrong.
I used https://bugs.python.org/issue35059 for all changes converting macros to static inline functions. Would you prefer a new dedicated issue for this change? |
Sorry, something went wrong.
|
Right now, I'm not sure that this change is correct. I'm not sure that _PyThreadState_GET() and _PyInterpreterState_GET_UNSAFE() must be called with the GIL hold. |
Sorry, something went wrong.
|
As @serhiy-storchaka wrote, this change looks dangerous. There is a risk of regression. I'm not sure that it's really worth it. I prefer to close my PR. |
Sorry, something went wrong.
Convert _PyThreadState_GET() and _PyInterpreterState_GET_UNSAFE()
macros to static inline functions, and the functions now check that
the GIL is hold.
Add _PyThreadState_GET_UNSAFE(): similar to _PyThreadState_GET(), but
don't check that the GIL is hold.
https://bugs.python.org/issue35059