Different thread for each principal state

parent 69011a93
Pipeline #823 passed with stages
in 1 minute and 38 seconds
......@@ -55,22 +55,28 @@ func verifyActiveStages(
var err error
oldKnown := len(valAttackerState.Known)
valAttackerState = attackerStateGetRead()
scanGroup.Add(len(valPrincipalStates))
for _, valPrincipalState := range valPrincipalStates {
var valMutationMap MutationMap
valMutationMap, err = mutationMapInit(
valKnowledgeMap, valPrincipalState, valAttackerState, stage,
)
if err != nil {
break
}
scanGroup.Add(1)
err = verifyActiveScan(
valKnowledgeMap, valPrincipalState, valAttackerState,
mutationMapNext(valMutationMap), stage, &scanGroup,
)
if err != nil {
break
}
go func(valPrincipalState *PrincipalState) {
var valMutationMap MutationMap
valMutationMap, err = mutationMapInit(
valKnowledgeMap, valPrincipalState, valAttackerState, stage,
)
if err != nil {
scanGroup.Done()
return
}
scanGroup.Add(1)
err = verifyActiveScan(
valKnowledgeMap, valPrincipalState, valAttackerState,
mutationMapNext(valMutationMap), stage, &scanGroup,
)
if err != nil {
scanGroup.Done()
return
}
scanGroup.Done()
}(valPrincipalState)
}
scanGroup.Wait()
exhausted := (stage > 5 && (oldKnown == len(valAttackerState.Known)))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment