File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -188,10 +188,14 @@ impl Locator for Hatch {
188188 // unrelated virtualenvwrapper / `venv` env in the same directory
189189 // would be misclassified as Hatch-managed.
190190 if classification. is_none ( ) {
191- let cache = self
191+ // Snapshot the cache (cheap `Arc` clones) under the lock and
192+ // release it before iterating, to keep `configure()` from being
193+ // blocked by callers on the hot identification path.
194+ let cache: Vec < Arc < WorkspaceEntry > > = self
192195 . workspace_virtual_dirs
193196 . lock ( )
194- . expect ( "workspace_virtual_dirs mutex poisoned" ) ;
197+ . expect ( "workspace_virtual_dirs mutex poisoned" )
198+ . clone ( ) ;
195199 ' workspaces: for entry in cache. iter ( ) {
196200 for virtual_dir in & entry. virtual_dirs {
197201 if prefix_is_directly_under ( & prefix, virtual_dir) {
You can’t perform that action at this time.
0 commit comments