Lock KillAll.

Signed-off-by: Lantao Liu <lantaol@google.com>
This commit is contained in:
Lantao Liu 2018-11-19 15:19:35 -08:00
parent f801661dcf
commit 7d91d631e0

View File

@ -356,6 +356,9 @@ func (p *Init) kill(ctx context.Context, signal uint32, all bool) error {
// KillAll processes belonging to the init process // KillAll processes belonging to the init process
func (p *Init) KillAll(ctx context.Context) error { func (p *Init) KillAll(ctx context.Context) error {
p.mu.Lock()
defer p.mu.Unlock()
err := p.runtime.Kill(ctx, p.id, int(syscall.SIGKILL), &runc.KillOpts{ err := p.runtime.Kill(ctx, p.id, int(syscall.SIGKILL), &runc.KillOpts{
All: true, All: true,
}) })