From a891afad6d7e3b09bafdccb4cc4b9fc4e577620e Mon Sep 17 00:00:00 2001 From: Fabricio Voznika Date: Fri, 28 Dec 2018 13:47:19 -0800 Subject: Simplify synchronization between runsc and sandbox process Make 'runsc create' join cgroup before creating sandbox process. This removes the need to synchronize platform creation and ensure that sandbox process is charged to the right cgroup from the start. PiperOrigin-RevId: 227166451 Change-Id: Ieb4b18e6ca0daf7b331dc897699ca419bc5ee3a2 --- runsc/cgroup/cgroup.go | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'runsc/cgroup/cgroup.go') diff --git a/runsc/cgroup/cgroup.go b/runsc/cgroup/cgroup.go index 15071387b..2887f3d7f 100644 --- a/runsc/cgroup/cgroup.go +++ b/runsc/cgroup/cgroup.go @@ -241,6 +241,11 @@ func (c *Cgroup) Uninstall() error { return nil } +// Join adds the current process to the all controllers. +func (c *Cgroup) Join() error { + return c.Add(0) +} + // Add adds given process to all controllers. func (c *Cgroup) Add(pid int) error { for key := range controllers { -- cgit v1.2.3