mirror of
https://github.com/python/cpython.git
synced 2026-05-05 01:51:01 +00:00
Make _find_and_load() acquire the module locks for the full dotted-name chain (parent before child) when loading a nested module, so both threads contend on the same first lock and serialise instead of deadlocking. When acquiring a parent's lock would itself deadlock with another thread that is loading that parent (cross-package circular imports), the parent's lock is skipped and the partially-initialised parent is accepted -- the same policy _lock_unlock_module() already applies on the existing code path -- so concurrent circular imports that worked before continue to work. |
||
|---|---|---|
| .. | ||
| metadata | ||
| resources | ||
| __init__.py | ||
| _abc.py | ||
| _bootstrap.py | ||
| _bootstrap_external.py | ||
| abc.py | ||
| machinery.py | ||
| readers.py | ||
| simple.py | ||
| util.py | ||