Robust pid locking for shim processes

Closes #2832

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
This commit is contained in:
Michael Crosby
2019-06-21 15:28:16 -04:00
parent bb9616ba20
commit 719a2c594e
5 changed files with 35 additions and 9 deletions

View File

@@ -47,6 +47,12 @@ func (s *safePid) get() int {
return s.pid
}
func (s *safePid) set(pid int) {
s.Lock()
s.pid = pid
s.Unlock()
}
// TODO(mlaventure): move to runc package?
func getLastRuntimeError(r *runc.Runc) (string, error) {
if r.Log == "" {