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
[breaking] daemon: Fix concurrency and streamline access to PackageManager (#1828)
* legacy: Removed ToolsLoader step
It has been splitted and merged into HardwareLoader and TargetBoardResolver
that are more appropriate.
* Fixed some function comments
* Thread-safe protect access to instances map
* Removed state-altering methods from PackageManager
They have been moved into a Builder object that has the ability to build
a new PackageManager. This allows to clearly separate subrotuines that
actually change the status of the PackageManager from subroutines that
just need to query it.
* Created packagemanager.Explorer to query PackageManager data
The Explorer object can be see as a read-only "view" to the underlying
PackageManager: we may ask the PackageManager to create an Explorer on
itself. The returned explorer will held a read-lock on the
PackageManager until it's disposed.
This architecture should prevent unwanted changes on the PackageManager
while it's being used, and viceversa, when the PackageManager is updated
it should be guaranteed that no Explorers are reading it.
* PlatformInstall/Uninstall must release PackageManager.Explorer before calling commands.Init
Otherwise, since Init will try to take a write-lock, it will block
indefinitely.
* Moved commands.InstanceContainer -> rpc.InstanceCommand
* Created a coreInstancesContainer
This container will handle all the atomic access to the instances map.
* Made CoreInstance.PackageManager field private
* Moved the reminder of PackageManager functions to Explorer or Builder
* Now GetPackageManager accepts an rpc.InstanceCommand
It has also been deprecated in favor of GetPackageManagerExplorer.
* Now GetLibraryManager accepts an rpc.InstanceCommand
* Refactored automatic builtin-tool installation
* Added gRPC LibraryUpgrade call and fixed 'lib upgrade' command
* Explorer and Builder should not extend PackageManager
Previuosly the methods PackageManager.NewBuilder and
PackageManager.NewExplorer were available also on Builder and Explorer.
Now Builder and Explorer does not inherith these methods anymore,
avoiding trivial errors like the one fixed in this commit in the
builder_utils package.
* Updated documentation
* Apply suggestions from code review
Co-authored-by: per1234 <[email protected]>
0 commit comments