Merge pull request #970 from hqhq/fix_race_cgroup_paths
Fix race condition when using cgroups.Paths
This commit is contained in:
commit
0c6733d669
|
@ -104,6 +104,8 @@ func (m *Manager) Apply(pid int) (err error) {
|
|||
if m.Cgroups == nil {
|
||||
return nil
|
||||
}
|
||||
m.mu.Lock()
|
||||
defer m.mu.Unlock()
|
||||
|
||||
var c = m.Cgroups
|
||||
|
||||
|
@ -128,8 +130,6 @@ 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 {
|
||||
|
|
Loading…
Reference in New Issue