mirror of
https://github.com/python/cpython.git
synced 2026-06-05 17:31:21 +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. |
||
|---|---|---|
| .. | ||
| builtin | ||
| extension | ||
| frozen | ||
| import_ | ||
| metadata | ||
| namespace_pkgs | ||
| partial | ||
| resources | ||
| source | ||
| __init__.py | ||
| __main__.py | ||
| abc.py | ||
| test_abc.py | ||
| test_api.py | ||
| test_discover.py | ||
| test_lazy.py | ||
| test_locks.py | ||
| test_namespace_pkgs.py | ||
| test_pkg_import.py | ||
| test_spec.py | ||
| test_threaded_import.py | ||
| test_util.py | ||
| test_windows.py | ||
| threaded_import_hangers.py | ||
| util.py | ||