Skip to content

Commit

Permalink
Fix usage of Cond.Signal().
Browse files Browse the repository at this point in the history
  • Loading branch information
kmfukuyama committed Sep 14, 2020
1 parent 72de1f4 commit 3038614
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions process/process.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,6 @@ package process

import (
"fmt"
"github.com/ochinchina/filechangemonitor"
"github.com/ochinchina/supervisord/config"
"github.com/ochinchina/supervisord/events"
"github.com/ochinchina/supervisord/logger"
"github.com/ochinchina/supervisord/signals"
"github.com/robfig/cron/v3"
log "github.com/sirupsen/logrus"
"io"
"os"
"os/exec"
Expand All @@ -21,6 +14,14 @@ import (
"sync/atomic"
"syscall"
"time"

"github.com/ochinchina/filechangemonitor"
"github.com/ochinchina/supervisord/config"
"github.com/ochinchina/supervisord/events"
"github.com/ochinchina/supervisord/logger"
"github.com/ochinchina/supervisord/signals"
"github.com/robfig/cron/v3"
log "github.com/sirupsen/logrus"
)

// State the state of process
Expand Down Expand Up @@ -159,14 +160,12 @@ func (p *Process) Start(wait bool) {
go func() {

for {
if wait {
runCond.L.Lock()
}
p.run(func() {
finished = true
if wait {
runCond.L.Unlock()
runCond.L.Lock()
runCond.Signal()
runCond.L.Unlock()
}
})
//avoid print too many logs if fail to start program too quickly
Expand Down

0 comments on commit 3038614

Please sign in to comment.