summaryrefslogtreecommitdiff
path: root/worker.go
diff options
context:
space:
mode:
authorWolfy-J <[email protected]>2018-06-06 12:41:49 +0300
committerWolfy-J <[email protected]>2018-06-06 12:41:49 +0300
commitaefb8c50d2c691cac113d9ccbbfbcbd30635ee6a (patch)
treefc5ecf4301c191ef503ca41058882ed5e8bc13d3 /worker.go
parentf762cd2bff2fa35e32bc4502c97d2ee0984397b7 (diff)
Cs and refactoring
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()
}
}