RegisterMemoryEvent allows the ability to register for all v1 memory cgroups notifications.
(event MemoryEvent)
| 486 | // RegisterMemoryEvent allows the ability to register for all v1 memory cgroups |
| 487 | // notifications. |
| 488 | func (c *cgroup) RegisterMemoryEvent(event MemoryEvent) (uintptr, error) { |
| 489 | c.mu.Lock() |
| 490 | defer c.mu.Unlock() |
| 491 | if c.err != nil { |
| 492 | return 0, c.err |
| 493 | } |
| 494 | s := c.getSubsystem(Memory) |
| 495 | if s == nil { |
| 496 | return 0, ErrMemoryNotSupported |
| 497 | } |
| 498 | sp, err := c.path(Memory) |
| 499 | if err != nil { |
| 500 | return 0, err |
| 501 | } |
| 502 | return s.(*memoryController).memoryEvent(sp, event) |
| 503 | } |
| 504 | |
| 505 | // State returns the state of the cgroup and its processes |
| 506 | func (c *cgroup) State() State { |
nothing calls this directly
no test coverage detected