File tree Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ import (
2222 "fmt"
2323 "io/ioutil"
2424 "net/http"
25+ "sync"
2526
2627 "github.com/arduino/arduino-cli/cli/globals"
2728 "github.com/arduino/arduino-cli/commands"
@@ -33,6 +34,7 @@ import (
3334var (
3435 // ErrNotFound is returned when the API returns 404
3536 ErrNotFound = errors .New ("board not found" )
37+ m sync.Mutex
3638)
3739
3840func apiByVidPid (url string ) ([]* rpc.BoardListItem , error ) {
@@ -78,6 +80,9 @@ func apiByVidPid(url string) ([]*rpc.BoardListItem, error) {
7880
7981// List FIXMEDOC
8082func List (instanceID int32 ) ([]* rpc.DetectedPort , error ) {
83+ m .Lock ()
84+ defer m .Unlock ()
85+
8186 pm := commands .GetPackageManager (instanceID )
8287 if pm == nil {
8388 return nil , errors .New ("invalid instance" )
You can’t perform that action at this time.
0 commit comments