chore: using xsync.MapOf replace sync.Map

This commit is contained in:
wwqgtxx
2023-09-02 16:54:35 +08:00
parent 73fa79bf3f
commit 1cad615b25
14 changed files with 110 additions and 86 deletions

View File

@@ -318,8 +318,7 @@ func handleUDPConn(packet C.PacketAdapter) {
return
}
lockKey := key + "-lock"
cond, loaded := natTable.GetOrCreateLock(lockKey)
cond, loaded := natTable.GetOrCreateLock(key)
go func() {
defer packet.Drop()
@@ -333,7 +332,7 @@ func handleUDPConn(packet C.PacketAdapter) {
}
defer func() {
natTable.Delete(lockKey)
natTable.DeleteLock(key)
cond.Broadcast()
}()