mirror of
https://github.com/chainreactors/spray.git
synced 2026-10-29 11:50:52 +00:00
给map 添加写锁
This commit is contained in:
1 parent
e682bd4fe5
commit
0f4529fede
1 file changed
+3
@@ -425,7 +425,10 @@ func (p *Pool) CompareWithExpr(exp *vm.Program, other *pkg.Baseline) bool {
|
||||
func (p *Pool) addFuzzyBaseline(bl *pkg.Baseline) {
|
||||
if _, ok := p.baselines[bl.Status]; !ok && IntsContains(FuzzyStatus, bl.Status) {
|
||||
bl.Collect()
|
||||
var lock sync.Mutex
|
||||
lock.Lock()
|
||||
p.baselines[bl.Status] = bl
|
||||
lock.Unlock()
|
||||
logs.Log.Importantf("[baseline.%dinit] %s", bl.Status, bl.String())
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user