MCPcopy Create free account
hub / github.com/containerd/cgroups / New

Method New

cgroup1/cgroup.go:132–148  ·  view source on GitHub ↗

New returns a new sub cgroup

(name string, resources *specs.LinuxResources)

Source from the content-addressed store, hash-verified

130
131// New returns a new sub cgroup
132func (c *cgroup) New(name string, resources *specs.LinuxResources) (Cgroup, error) {
133 c.mu.Lock()
134 defer c.mu.Unlock()
135 if c.err != nil {
136 return nil, c.err
137 }
138 path := subPath(c.path, name)
139 for _, s := range c.subsystems {
140 if err := initializeSubsystem(s, path, resources); err != nil {
141 return nil, err
142 }
143 }
144 return &cgroup{
145 path: path,
146 subsystems: c.subsystems,
147 }, nil
148}
149
150// Subsystems returns all the subsystems that are currently being
151// consumed by the group

Callers

nothing calls this directly

Calls 2

subPathFunction · 0.85
initializeSubsystemFunction · 0.85

Tested by

no test coverage detected