diff options
author | Lantao Liu <taotaotheripper@gmail.com> | 2019-01-30 09:50:10 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-01-30 09:50:10 -0800 |
commit | 326bc9f3bac1b89414950772ac0cb87619b847d9 (patch) | |
tree | 9cb38bf649fa34a61c43cc9eba877d4beb085af2 /pkg/v1/proc/exec.go | |
parent | 35db607dfccd3c03b69f1a42c58cf58ec8259e37 (diff) |
Update to containerd 1.2.2 (#14)
* Update containerd to 1.2.2
Signed-off-by: Lantao Liu <lantaol@google.com>
* Port https://github.com/containerd/containerd/pull/2803.
Signed-off-by: Lantao Liu <lantaol@google.com>
Diffstat (limited to 'pkg/v1/proc/exec.go')
-rw-r--r-- | pkg/v1/proc/exec.go | 37 |
1 files changed, 36 insertions, 1 deletions
diff --git a/pkg/v1/proc/exec.go b/pkg/v1/proc/exec.go index f4f9f46e2..f02b73bb2 100644 --- a/pkg/v1/proc/exec.go +++ b/pkg/v1/proc/exec.go @@ -42,7 +42,7 @@ import ( type execProcess struct { wg sync.WaitGroup - proc.State + execState execState mu sync.Mutex id string @@ -88,6 +88,13 @@ func (e *execProcess) ExitedAt() time.Time { return e.exited } +func (e *execProcess) SetExited(status int) { + e.mu.Lock() + defer e.mu.Unlock() + + e.execState.SetExited(status) +} + func (e *execProcess) setExited(status int) { e.status = status e.exited = time.Now() @@ -95,6 +102,13 @@ func (e *execProcess) setExited(status int) { close(e.waitBlock) } +func (e *execProcess) Delete(ctx context.Context) error { + e.mu.Lock() + defer e.mu.Unlock() + + return e.execState.Delete(ctx) +} + func (e *execProcess) delete(ctx context.Context) error { e.wg.Wait() if e.io != nil { @@ -112,6 +126,13 @@ func (e *execProcess) delete(ctx context.Context) error { return nil } +func (e *execProcess) Resize(ws console.WinSize) error { + e.mu.Lock() + defer e.mu.Unlock() + + return e.execState.Resize(ws) +} + func (e *execProcess) resize(ws console.WinSize) error { if e.console == nil { return nil @@ -119,6 +140,13 @@ func (e *execProcess) resize(ws console.WinSize) error { return e.console.Resize(ws) } +func (e *execProcess) Kill(ctx context.Context, sig uint32, _ bool) error { + e.mu.Lock() + defer e.mu.Unlock() + + return e.execState.Kill(ctx, sig, false) +} + func (e *execProcess) kill(ctx context.Context, sig uint32, _ bool) error { internalPid := e.internalPid if internalPid != 0 { @@ -141,6 +169,13 @@ func (e *execProcess) Stdio() proc.Stdio { return e.stdio } +func (e *execProcess) Start(ctx context.Context) error { + e.mu.Lock() + defer e.mu.Unlock() + + return e.execState.Start(ctx) +} + func (e *execProcess) start(ctx context.Context) (err error) { var ( socket *runc.Socket |