Expand description
Interaction with Python’s global interpreter lock
Structs
Struct used internally which avoids acquiring the GIL where it’s not necessary.
RAII type that represents the Global Interpreter Lock acquisition.
A RAII pool which PyO3 uses to store owned Python references.
Thread-safe storage for objects which were inc_ref / dec_ref while the GIL was not held.
Constants
This is an internal counter in pyo3 monitoring whether this thread has the GIL.
Temporarily hold objects that will be released when the GILPool drops.
Statics
Functions
Decrements pyo3’s internal GIL count - to be called whenever GILPool or GILGuard is dropped.
Ensures the GIL is held, used in the implementation of Python::with_gil
.
Ensures the GIL is held, without interpreter state checking.
Checks whether the GIL is acquired.
Increments pyo3’s internal GIL count - to be called whenever GILPool or GILGuard is created.
PyPy
Prepares the use of Python in a free-threaded context.
Registers a Python object pointer inside the release pool, to have its reference count decreased the next time the GIL is acquired in pyo3.
Registers a Python object pointer inside the release pool, to have its reference count increased the next time the GIL is acquired in pyo3.
Registers an owned object inside the GILPool, to be released when the GILPool drops.
Executes the provided closure with an embedded Python interpreter.