Added AllowedToTakeLock to SimpleThread that allows children to inherit locks
parent
7a95af6db2
commit
88d8113b5c
|
|
@ -521,6 +521,15 @@ func (thread * SimpleThread) ClearTimeout() {
|
|||
thread.timeout_chan = nil
|
||||
}
|
||||
|
||||
func (thread * SimpleThread) AllowedToTakeLock(new_owner Lockable, lockable Lockable) bool {
|
||||
for _, child := range(thread.children) {
|
||||
if new_owner.ID() == child.ID() {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
var ThreadStart = func(ctx * Context, thread Thread) error {
|
||||
err := UpdateStates(ctx, []Node{thread}, func(nodes NodeMap) error {
|
||||
owner_id := NodeID("")
|
||||
|
|
|
|||
Loading…
Reference in New Issue