aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Python/lock.c
diff options
context:
space:
mode:
authorSam Gross <colesbury@gmail.com>2025-07-01 13:26:13 -0400
committerGitHub <noreply@github.com>2025-07-01 13:26:13 -0400
commitf41e9c750e6971c165e055374a1014d6afd2d50e (patch)
treebf1e4a487d006801b57374769904761ecbed3c2d /Python/lock.c
parent86c3316183a79867e3c666d0830f897e16f0f339 (diff)
downloadcpython-f41e9c750e6971c165e055374a1014d6afd2d50e.tar.gz
cpython-f41e9c750e6971c165e055374a1014d6afd2d50e.zip
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.
Diffstat (limited to 'Python/lock.c')
-rw-r--r--Python/lock.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/Python/lock.c b/Python/lock.c
index eb09019e0a2..a49d587a168 100644
--- a/Python/lock.c
+++ b/Python/lock.c
@@ -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);
+}