From 5c3a14bdbd567fda8e36ee5f64c6d587cb02ffb3 Mon Sep 17 00:00:00 2001 From: Noah Metz Date: Mon, 24 Jul 2023 20:27:02 -0600 Subject: [PATCH] fix --- thread.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/thread.go b/thread.go index 1cfcb33..65bbe77 100644 --- a/thread.go +++ b/thread.go @@ -88,14 +88,15 @@ func LinkThreads(context *StateContext, princ Node, thread_node ThreadNode, info } thread := thread_node.ThreadHandle() child := info.Child.ThreadHandle() + child_node := info.Child if thread.ID() == child.ID() { return fmt.Errorf("Will not link %s as a child of itself", thread.ID()) } return UpdateStates(context, princ, LockMap{ - child.ID(): LockInfo{Node: child, Resources: []string{"parent"}}, - thread.ID(): LockInfo{Node: thread, Resources: []string{"children"}}, + child.ID(): LockInfo{Node: child_node, Resources: []string{"parent"}}, + thread.ID(): LockInfo{Node: thread_node, Resources: []string{"children"}}, }, func(context *StateContext) error { if child.Parent != nil { return fmt.Errorf("EVENT_LINK_ERR: %s already has a parent, cannot link as child", child.ID())