Skip to content

Commit

Permalink
move mutex
Browse files Browse the repository at this point in the history
  • Loading branch information
skudasov committed Dec 19, 2024
1 parent 1fb6499 commit 23551b9
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions wasp/wasp.go
Original file line number Diff line number Diff line change
Expand Up @@ -513,20 +513,20 @@ func (g *Generator) processSegment() bool {
return false
}
if oldVUs > g.currentSegment.From {
g.vusMu.Lock()
for i := 0; i < vusToSpawn; i++ {
g.vusMu.Lock()
g.vus[i].Stop(g)
g.vusMu.Unlock()
}
g.vus = g.vus[vusToSpawn:]
g.vusMu.Unlock()
} else {
g.vusMu.Lock()
for i := 0; i < vusToSpawn; i++ {
inst := g.vu.Clone(g)
g.runVU(inst)
g.vusMu.Lock()
g.vus = append(g.vus, inst)
g.vusMu.Unlock()
}
g.vusMu.Unlock()
}
}
return false
Expand Down Expand Up @@ -632,9 +632,9 @@ func (g *Generator) pacedCall() {
if !g.Stats().RunStarted.Load() {
return
}
//if g.rl.Load() == nil {
// return
//}
if g.rl.Load() == nil {
return
}
(*g.rl.Load()).Take()
if g.stats.RunPaused.Load() {
return
Expand Down

0 comments on commit 23551b9

Please sign in to comment.