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 (
22
22
"fmt"
23
23
"io/ioutil"
24
24
"net/http"
25
+ "sync"
25
26
26
27
"github.com/arduino/arduino-cli/cli/globals"
27
28
"github.com/arduino/arduino-cli/commands"
@@ -33,6 +34,7 @@ import (
33
34
var (
34
35
// ErrNotFound is returned when the API returns 404
35
36
ErrNotFound = errors .New ("board not found" )
37
+ m sync.Mutex
36
38
)
37
39
38
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
80
82
func List (instanceID int32 ) ([]* rpc.DetectedPort , error ) {
83
+ m .Lock ()
84
+ defer m .Unlock ()
85
+
81
86
pm := commands .GetPackageManager (instanceID )
82
87
if pm == nil {
83
88
return nil , errors .New ("invalid instance" )
You can’t perform that action at this time.
0 commit comments