Skip to content

Commit

Permalink
netview: move lock in Config to prevent deadlock for BuildNetwork whe…
Browse files Browse the repository at this point in the history
…n netview is open, and make params.Sel 30 wide in edit
  • Loading branch information
Randall C. O'Reilly committed May 19, 2020
1 parent ec588ca commit 800d2c5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
5 changes: 2 additions & 3 deletions netview/netview.go
Original file line number Diff line number Diff line change
Expand Up @@ -199,9 +199,6 @@ func (nv *NetView) UpdateImpl() {

// Config configures the overall view widget
func (nv *NetView) Config() {
nv.DataMu.Lock()
defer nv.DataMu.Unlock()

nv.Lay = gi.LayoutVert
if nv.Params.UnitSize == 0 {
nv.Defaults()
Expand Down Expand Up @@ -243,7 +240,9 @@ func (nv *NetView) Config() {
ctrs.Redrawable = true
ctrs.SetText("Counters: ")

nv.DataMu.Lock()
nv.Data.Init(nv.Net, nv.Params.MaxRecs)
nv.DataMu.Unlock()
nv.UpdateEnd(updt)
}

Expand Down
2 changes: 1 addition & 1 deletion params/params.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ var KiT_Params = kit.Types.AddType(&Params{}, ParamsProps)
// parameters, using standard css selector syntax (. prefix = class, # prefix = name,
// and no prefix = type)
type Sel struct {
Sel string `desc:"selector for what to apply the parameters to, using standard css selector syntax: .Example applies to anything with a Class tag of 'Example', #Example applies to anything with a Name of 'Example', and Example with no prefix applies to anything of type 'Example'"`
Sel string `width:"30" desc:"selector for what to apply the parameters to, using standard css selector syntax: .Example applies to anything with a Class tag of 'Example', #Example applies to anything with a Name of 'Example', and Example with no prefix applies to anything of type 'Example'"`
Desc string `width:"60" desc:"description of these parameter values -- what effect do they have? what range was explored? it is valuable to record this information as you explore the params."`
Params Params `view:"no-inline" desc:"parameter values to apply to whatever matches the selector"`
}
Expand Down

0 comments on commit 800d2c5

Please sign in to comment.