Expand description
Interaction with Python’s global interpreter lock
Structs§
- LockGIL 🔒
- Used to lock safe access to the GIL
- Reference
Pool 🔒Non- pyo3_disable_reference_pool
- Thread-safe storage for objects which were dec_ref while the GIL was not held.
- SuspendGIL 🔒
- A guard which can be used to temporarily release the GIL and restore on
Drop
.
Enums§
- GILGuard 🔒
- RAII type that represents the Global Interpreter Lock acquisition.
Constants§
- GIL_
COUNT 🔒 - This is an internal counter in pyo3 monitoring whether this thread has the GIL.
- GIL_
LOCKED_ 🔒DURING_ TRAVERSE
Statics§
Functions§
- decrement_
gil_ 🔒count - Decrements pyo3’s internal GIL count - to be called whenever GILPool or GILGuard is dropped.
- gil_
is_ 🔒acquired - Checks whether the GIL is acquired.
- increment_
gil_ 🔒count - Increments pyo3’s internal GIL count - to be called whenever GILPool or GILGuard is created.
- prepare_
freethreaded_ python Neither PyPy
norGraalPy
- Prepares the use of Python in a free-threaded context.
- register_
decref ⚠ - Registers a Python object pointer inside the release pool, to have its reference count decreased the next time the GIL is acquired in pyo3.
- register_
incref ⚠py-clone
- Increments the reference count of a Python object if the GIL is held. If the GIL is not held, this function will panic.
- with_
embedded_ ⚠python_ interpreter Neither PyPy
norGraalPy
- Executes the provided closure with an embedded Python interpreter.
Type Aliases§
- PyObj
Vec 🔒