mirror of
https://github.com/python/cpython.git
synced 2026-01-06 23:42:34 +00:00
gh-134009: Expose PyMutex_IsLocked in the public C API (gh-134365)
The `PyMutex_IsLocked()` function is useful in assertions for verifying that code maintains certain locking invariants.
This commit is contained in:
parent
86c3316183
commit
f41e9c750e
6 changed files with 39 additions and 7 deletions
|
|
@ -634,3 +634,11 @@ PyMutex_Unlock(PyMutex *m)
|
|||
Py_FatalError("unlocking mutex that is not locked");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#undef PyMutex_IsLocked
|
||||
int
|
||||
PyMutex_IsLocked(PyMutex *m)
|
||||
{
|
||||
return _PyMutex_IsLocked(m);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue