Update updates the cgroup with the new resource values provided Be prepared to handle EBUSY when trying to update a cgroup with live processes and other operations like Stats being performed at the same time
(resources *specs.LinuxResources)
| 351 | // live processes and other operations like Stats being performed at the |
| 352 | // same time |
| 353 | func (c *cgroup) Update(resources *specs.LinuxResources) error { |
| 354 | c.mu.Lock() |
| 355 | defer c.mu.Unlock() |
| 356 | if c.err != nil { |
| 357 | return c.err |
| 358 | } |
| 359 | for _, s := range c.subsystems { |
| 360 | if u, ok := s.(updater); ok { |
| 361 | sp, err := c.path(s.Name()) |
| 362 | if err != nil { |
| 363 | return err |
| 364 | } |
| 365 | if err := u.Update(sp, resources); err != nil { |
| 366 | return err |
| 367 | } |
| 368 | } |
| 369 | } |
| 370 | return nil |
| 371 | } |
| 372 | |
| 373 | // Processes returns the processes running inside the cgroup along |
| 374 | // with the subsystem used, pid, and path |