Skip to content

Commit dc52b11

Browse files
committed
concurrent fix:add RWlock
1 parent 7a4be9b commit dc52b11

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pingClient.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -742,7 +742,7 @@ func (p *PingClient) StatisticsPerIP(ipAddr *net.IPAddr) *Statistics {
742742
var ipStr string = ipAddr.IP.String()
743743
globalmu.RLock()
744744
loss := float64(p.PacketsSent[ipStr]-p.PacketsRecv[ipStr]) / float64(p.PacketsSent[ipStr]) * 100
745-
globalmu.Unlock()
745+
globalmu.RUnlock()
746746
var min, max, total time.Duration
747747
if len(p.rtts[ipStr]) > 0 {
748748
min = p.rtts[ipStr][0]

0 commit comments

Comments
 (0)