We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 549b0fb commit 20b8afaCopy full SHA for 20b8afa
commands/board/list.go
@@ -22,6 +22,7 @@ import (
22
"fmt"
23
"io/ioutil"
24
"net/http"
25
+ "sync"
26
27
"github.com/arduino/arduino-cli/cli/globals"
28
"github.com/arduino/arduino-cli/commands"
@@ -33,6 +34,7 @@ import (
33
34
var (
35
// ErrNotFound is returned when the API returns 404
36
ErrNotFound = errors.New("board not found")
37
+ m sync.Mutex
38
)
39
40
func apiByVidPid(url string) ([]*rpc.BoardListItem, error) {
@@ -78,6 +80,9 @@ func apiByVidPid(url string) ([]*rpc.BoardListItem, error) {
78
80
79
81
// List FIXMEDOC
82
func List(instanceID int32) ([]*rpc.DetectedPort, error) {
83
+ m.Lock()
84
+ defer m.Unlock()
85
+
86
pm := commands.GetPackageManager(instanceID)
87
if pm == nil {
88
return nil, errors.New("invalid instance")
0 commit comments