X Tutup
Skip to content

Commit fcf3b27

Browse files
committed
Add lock for ListPids
Signed-off-by: Shiming Zhang <wzshiming@foxmail.com>
1 parent 4f18131 commit fcf3b27

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

runtime/v1/shim/service.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -397,6 +397,9 @@ func (s *Service) ListPids(ctx context.Context, r *shimapi.ListPidsRequest) (*sh
397397
return nil, errdefs.ToGRPC(err)
398398
}
399399
var processes []*task.ProcessInfo
400+
401+
s.mu.Lock()
402+
defer s.mu.Unlock()
400403
for _, pid := range pids {
401404
pInfo := task.ProcessInfo{
402405
Pid: pid,

0 commit comments

Comments
 (0)
X Tutup