lock for gocui
This commit is contained in:
parent
be696b98aa
commit
5c033ce431
2
init.go
2
init.go
|
@ -38,7 +38,9 @@ func (me *TreeInfo) catchActionChannel() {
|
||||||
muAction.Lock()
|
muAction.Lock()
|
||||||
me.WaitOK()
|
me.WaitOK()
|
||||||
// time.Sleep(10 * time.Millisecond)
|
// time.Sleep(10 * time.Millisecond)
|
||||||
|
me.Lock()
|
||||||
me.doAction(a)
|
me.doAction(a)
|
||||||
|
me.Unlock()
|
||||||
muAction.Unlock()
|
muAction.Unlock()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,6 +7,8 @@ package tree
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"sync"
|
||||||
|
|
||||||
"go.wit.com/lib/protobuf/guipb"
|
"go.wit.com/lib/protobuf/guipb"
|
||||||
"go.wit.com/widget"
|
"go.wit.com/widget"
|
||||||
)
|
)
|
||||||
|
@ -18,6 +20,7 @@ import (
|
||||||
var treeRoot *Node
|
var treeRoot *Node
|
||||||
|
|
||||||
type TreeInfo struct {
|
type TreeInfo struct {
|
||||||
|
sync.Mutex // a lock around the tree to serialize access
|
||||||
ok bool // indicates the plugin actually initialized
|
ok bool // indicates the plugin actually initialized
|
||||||
PluginName string // used to identify the plugin
|
PluginName string // used to identify the plugin
|
||||||
config *ToolkitConfigs // protobuf of plugin settings
|
config *ToolkitConfigs // protobuf of plugin settings
|
||||||
|
|
Loading…
Reference in New Issue