From aefb8c50d2c691cac113d9ccbbfbcbd30635ee6a Mon Sep 17 00:00:00 2001 From: Wolfy-J Date: Wed, 6 Jun 2018 12:41:49 +0300 Subject: Cs and refactoring --- worker.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'worker.go') diff --git a/worker.go b/worker.go index e33ea327..c7fe136a 100644 --- a/worker.go +++ b/worker.go @@ -203,9 +203,10 @@ func (w *Worker) start() error { w.endState, _ = w.cmd.Process.Wait() if w.waitDone != nil { close(w.waitDone) + w.mu.Lock() + defer w.mu.Unlock() + if w.rl != nil { - w.mu.Lock() - defer w.mu.Unlock() w.rl.Close() } } -- cgit v1.2.3