Added AllowedToTakeLock to SimpleThread that allows children to inherit locks

graph-rework-2
noah metz 2023-07-11 16:13:57 -06:00
parent 7a95af6db2
commit 88d8113b5c
1 changed files with 9 additions and 0 deletions

@ -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("")