summaryrefslogtreecommitdiff
path: root/worker.go
diff options
context:
space:
mode:
Diffstat (limited to 'worker.go')
-rw-r--r--worker.go5
1 files changed, 3 insertions, 2 deletions
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()
}
}