You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
_imp.acquire_lock was only counting and not blocking, so replace it with a real lock (test_lock).
importlib._bootstrap was modified to resolve issues:
_SpecMethods.load on 3.4 could raise an exception on a None spec, leaving the lock acquired.
_get_module_lock set a callback on the weakref, which runs on the finalizer thread: on 3.4 it could delete a newer lock, and on 3.6 it took the lock, which could deadlock with gc.collect() (test_lock_gc_collect).
The code uses a private lock object. Maybe rather than using System.Object unconditionally, use System.Threading.Lock on .NET 9.0 and greater? See src/dlr/src/core/GlobalUsings.cs. I'd like to introduce this mechanism in all suitable places in IronPython as well, but we have to start somewhere.
@BCSharp I didn't go with the global usings approach but used a polyfill instead. Might be worth doing the same in the DLR now that we're using polyfills there...
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
_imp.acquire_lockwas only counting and not blocking, so replace it with a real lock (test_lock).importlib._bootstrapwas modified to resolve issues:_SpecMethods.loadon 3.4 could raise an exception on aNonespec, leaving the lock acquired._get_module_lockset a callback on the weakref, which runs on the finalizer thread: on 3.4 it could delete a newer lock, and on 3.6 it took the lock, which could deadlock withgc.collect()(test_lock_gc_collect).