diff --git a/worker2/dep.go b/worker2/dep.go index 9418821c..79672597 100644 --- a/worker2/dep.go +++ b/worker2/dep.go @@ -240,10 +240,19 @@ func (g *Group) LinkDeps() { } func (g *Group) GetDepsObj() *Deps { + if g.Deps != nil { + return g.Deps + } + + g.m.Lock() + defer g.m.Unlock() + if g.Deps == nil { - g.Deps = NewDeps() + d := NewDeps() + d.setOwner(g) + g.Deps = d } - g.Deps.setOwner(g) + return g.Deps }