New returns a new sub cgroup
(name string, resources *specs.LinuxResources)
| 130 | |
| 131 | // New returns a new sub cgroup |
| 132 | func (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 |
nothing calls this directly
no test coverage detected