@@ -66,7 +66,7 @@ type Init struct {
|
||||
pausing *atomicBool
|
||||
status int
|
||||
exited time.Time
|
||||
pid safePid
|
||||
pid int
|
||||
closers []io.Closer
|
||||
stdin io.Closer
|
||||
stdio stdio.Stdio
|
||||
@@ -116,8 +116,6 @@ func (p *Init) Create(ctx context.Context, r *CreateConfig) error {
|
||||
pio *processIO
|
||||
pidFile = newPidFile(p.Bundle)
|
||||
)
|
||||
p.pid.Lock()
|
||||
defer p.pid.Unlock()
|
||||
|
||||
if r.Terminal {
|
||||
if socket, err = runc.NewTempConsoleSocket(); err != nil {
|
||||
@@ -173,7 +171,7 @@ func (p *Init) Create(ctx context.Context, r *CreateConfig) error {
|
||||
if err != nil {
|
||||
return errors.Wrap(err, "failed to retrieve OCI runtime container pid")
|
||||
}
|
||||
p.pid.pid = pid
|
||||
p.pid = pid
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -219,7 +217,7 @@ func (p *Init) ID() string {
|
||||
|
||||
// Pid of the process
|
||||
func (p *Init) Pid() int {
|
||||
return p.pid.get()
|
||||
return p.pid
|
||||
}
|
||||
|
||||
// ExitStatus of the process
|
||||
@@ -275,7 +273,6 @@ func (p *Init) setExited(status int) {
|
||||
p.exited = time.Now()
|
||||
p.status = status
|
||||
p.Platform.ShutdownConsole(context.Background(), p.console)
|
||||
p.pid.set(StoppedPID)
|
||||
close(p.waitBlock)
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user