diff options
Diffstat (limited to 'pkg/sentry/fsimpl/cgroupfs/base.go')
-rw-r--r-- | pkg/sentry/fsimpl/cgroupfs/base.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/pkg/sentry/fsimpl/cgroupfs/base.go b/pkg/sentry/fsimpl/cgroupfs/base.go index 360bbb17d..39c1013e1 100644 --- a/pkg/sentry/fsimpl/cgroupfs/base.go +++ b/pkg/sentry/fsimpl/cgroupfs/base.go @@ -167,8 +167,8 @@ func (d *cgroupProcsData) Generate(ctx context.Context, buf *bytes.Buffer) error pgids := make(map[kernel.ThreadID]struct{}) - d.fs.tasksMu.Lock() - defer d.fs.tasksMu.Unlock() + d.fs.tasksMu.RLock() + defer d.fs.tasksMu.RUnlock() for task := range d.ts { // Map dedups pgid, since iterating over all tasks produces multiple @@ -209,8 +209,8 @@ func (d *tasksData) Generate(ctx context.Context, buf *bytes.Buffer) error { var pids []kernel.ThreadID - d.fs.tasksMu.Lock() - defer d.fs.tasksMu.Unlock() + d.fs.tasksMu.RLock() + defer d.fs.tasksMu.RUnlock() for task := range d.ts { if pid := currPidns.IDOfTask(task); pid != 0 { |