mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-08-29 10:09:43 +02:00
Document CmdPal lifecycle contracts
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 7a42451c-0ec4-4778-86fd-c77d7ac9d122
This commit is contained in:
@@ -51,6 +51,9 @@ internal static class ExtensionTaskCoordinator
|
||||
});
|
||||
|
||||
var results = await Task.WhenAll(tasks).ConfigureAwait(false);
|
||||
|
||||
// Cancellation is not partial success. The current reload may stop here, and the next
|
||||
// reload stops every service before rediscovering all providers.
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
return results.OfType<TResult>().ToArray();
|
||||
}
|
||||
|
||||
@@ -82,6 +82,9 @@ public sealed partial class JsonRpcExtensionService : IExtensionService, IDispos
|
||||
private static readonly string ExtensionsPath = GetDefaultExtensionsPath();
|
||||
|
||||
private readonly TaskScheduler _taskScheduler;
|
||||
|
||||
// This gate lives for the service lifetime. Disposing it while a start owns a permit
|
||||
// could make its matching Release throw.
|
||||
private readonly SemaphoreSlim _extensionStartupGate = new(MaxConcurrentExtensionStarts, MaxConcurrentExtensionStarts);
|
||||
private readonly Lock _extensionsLock = new();
|
||||
private readonly List<JSExtensionWrapper> _extensions = [];
|
||||
|
||||
Reference in New Issue
Block a user