mirror of
https://github.com/python/cpython.git
synced 2025-10-17 04:08:28 +00:00
gh-128360: Add _Py_AssertHoldsTstate
as assertion for holding a thread state (#128361)
Co-authored-by: Kumar Aditya <kumaraditya@python.org>
This commit is contained in:
parent
c6b570e5e3
commit
4d0a6595a0
11 changed files with 48 additions and 32 deletions
|
@ -995,7 +995,7 @@ _Py_unset_eval_breaker_bit_all(PyInterpreterState *interp, uintptr_t bit)
|
|||
void
|
||||
_Py_FinishPendingCalls(PyThreadState *tstate)
|
||||
{
|
||||
assert(PyGILState_Check());
|
||||
_Py_AssertHoldsTstate();
|
||||
assert(_PyThreadState_CheckConsistency(tstate));
|
||||
|
||||
struct _pending_calls *pending = &tstate->interp->ceval.pending;
|
||||
|
@ -1056,7 +1056,7 @@ _PyEval_MakePendingCalls(PyThreadState *tstate)
|
|||
int
|
||||
Py_MakePendingCalls(void)
|
||||
{
|
||||
assert(PyGILState_Check());
|
||||
_Py_AssertHoldsTstate();
|
||||
|
||||
PyThreadState *tstate = _PyThreadState_GET();
|
||||
assert(_PyThreadState_CheckConsistency(tstate));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue