-
Notifications
You must be signed in to change notification settings - Fork 1
Closed
Description
Links
CPython Issue: python/cpython#117511
PR draft: python/cpython#117731
Additional discussion: https://discuss.python.org/t/make-some-pymutex-apis-public/50203
Overview
The PyMutex
APIs are currently internal-only in pycore_lock.h
. This proposes making the type and two functions public as part of the general, non-limited API in Include/cpython/lock.h
.
The APIs to be included in the public header are:
typedef struct PyMutex { ... } PyMutex;
static inline void PyMutex_Lock(PyMutex *m) { ... }
static inline void PyMutex_Unlock(PyMutex *m) { ... }
Additionally, the out-of line of "slow path" functions are exposed in the header, but not part of the public API. (For context, these are called when PyMutex_Lock
needs to block and when PyMutex_Unlock
needs to wake up another waiting thread).
// (private) slow path for locking the mutex
PyAPI_FUNC(void) _PyMutex_LockSlow(PyMutex *m);
// (private) slow path for unlocking the mutex
PyAPI_FUNC(void) _PyMutex_UnlockSlow(PyMutex *m);
erlend-aasland
Metadata
Metadata
Assignees
Labels
No labels