Closed
Description
Feature or enhancement
Proposal:
In some older areas of the codebase, we have the following to ensure that the caller holds the GIL (or really, an attached thread state):
assert(PyGILState_Check())
This doesn't work for subinterpreters, because GILstate checks are disabled when subinterpreters exist. This hasn't been an issue in practice, but it would be nice to get these replaced with more correct thread state checks. I think a helper function that calls _Py_EnsureTstateNotNULL
if assertions are enabled would work nicely.
Has this already been discussed elsewhere?
No response given
Links to previous discussion of this feature:
No response
Linked PRs
Metadata
Metadata
Assignees
Projects
Status
Done