File tree Expand file tree Collapse file tree 1 file changed +5
-0
lines changed
src/Features/Core/Portable/Extensions Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -158,6 +158,8 @@ private async ValueTask<VoidResult> UnregisterExtensionInCurrentProcessAsync(
158158 var assemblyFolderPath = Path . GetDirectoryName ( assemblyFilePath )
159159 ?? throw new InvalidOperationException ( $ "Unable to get the directory name for { assemblyFilePath } .") ;
160160
161+ // Note: unregistering is slightly expensive as we do everything under a lock, to ensure that we have a
162+ // consistent view of the world. This is fine as we don't expect this to be called very often.
161163 using ( await _gate . DisposableWaitAsync ( cancellationToken ) . ConfigureAwait ( false ) )
162164 {
163165 if ( _folderPathToExtensionFolder . TryGetValue ( assemblyFolderPath , out var lazyExtensionFolder ) )
@@ -288,6 +290,9 @@ private static async Task<ImmutableArray<IExtensionMessageHandlerWrapper<TResult
288290
289291 private abstract class ExtensionFolder
290292 {
293+ /// <summary>
294+ /// Mapping from assembly file path to the handlers it contains. Used as its own lock when mutating.
295+ /// </summary>
291296 private readonly Dictionary < string , AsyncLazy < AssemblyHandlers > > _assemblyFilePathToHandlers = new ( ) ;
292297
293298 protected abstract AssemblyHandlers CreateAssemblyHandlers ( string assemblyFilePath , CancellationToken cancellationToken ) ;
You can’t perform that action at this time.
0 commit comments