(id uint64)
| 313 | } |
| 314 | |
| 315 | func (this *IPList) remove(id uint64) { |
| 316 | this.locker.Lock() |
| 317 | ip, ok := this.idMap[id] |
| 318 | if ok { |
| 319 | ipId, ok := this.ipMap[ip] |
| 320 | if ok && ipId == id { |
| 321 | delete(this.ipMap, ip) |
| 322 | } |
| 323 | delete(this.idMap, id) |
| 324 | } |
| 325 | this.locker.Unlock() |
| 326 | } |
| 327 | |
| 328 | func (this *IPList) nextId() uint64 { |
| 329 | return atomic.AddUint64(&this.id, 1) |