Merge pull request #601 from LK4D4/fix_stats_race

Fix race between Apply and GetStats
This commit is contained in:
Mrunal Patel 2016-02-29 11:01:09 -08:00
commit 6fc66fea48
1 changed files with 2 additions and 0 deletions

View File

@ -130,6 +130,8 @@ func (m *Manager) Apply(pid int) (err error) {
return cgroups.EnterPid(m.Paths, pid)
}
m.mu.Lock()
defer m.mu.Unlock()
paths := make(map[string]string)
for _, sys := range subsystems {
if err := sys.Apply(d); err != nil {