mirror of
https://github.com/bettercap/bettercap
synced 2025-08-14 02:36:57 -07:00
Kepp sync.WorkerGroup.Add() outside of goroutine
The workergroup should be added before starting the worker. The worker routine itself should not start the worker. It causes race condition.
This commit is contained in:
parent
1fee1f718d
commit
050bd28511
3 changed files with 3 additions and 4 deletions
|
@ -227,8 +227,8 @@ func (mod *SynScanner) synScan() error {
|
|||
mod.State.Store("progress", 0.0)
|
||||
|
||||
// start the collector
|
||||
mod.waitGroup.Add(1)
|
||||
go func() {
|
||||
mod.waitGroup.Add(1)
|
||||
defer mod.waitGroup.Done()
|
||||
|
||||
for packet := range mod.packets {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue