Module sync

Source
Expand description

Synchronization mechanisms based on the Python GIL.

With the acceptance of PEP 703 (aka a “freethreaded Python”) for Python 3.13, these are likely to undergo significant developments in the future.

Modules§

once_lock_ext_sealed 🔒 rustc_has_once_lock

Structs§

GILOnceCell
A write-once primitive similar to std::sync::OnceLock<T>.
GILProtectedNon-Py_GIL_DISABLED
Value with concurrent access protected by the GIL.
Guard 🔒
Interned 👻
Implementation detail for intern! macro.

Traits§

OnceExt
Helper trait for Once to help avoid deadlocking when using a Once when attached to a Python thread.
OnceLockExtrustc_has_once_lock
interpreter and initialization with the OnceLock.

Functions§

init_once_force_py_attached 🔒
init_once_lock_py_attached 🔒 rustc_has_once_lock
init_once_py_attached 🔒
with_critical_section
Executes a closure with a Python critical section held on an object.
⚠️ Internal Docs ⚠️ Not Public API 👉 Official Docs Here