From c0c113036b5443092e21dbf92d9bbab418cdb505 Mon Sep 17 00:00:00 2001 From: mengskysama Date: Tue, 6 Dec 2016 14:57:15 +0800 Subject: [PATCH] statistics lock --- toolbox/statistics.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/toolbox/statistics.go b/toolbox/statistics.go index 69b88772..c6a9489f 100644 --- a/toolbox/statistics.go +++ b/toolbox/statistics.go @@ -117,7 +117,9 @@ func (m *URLMap) GetMap() map[string]interface{} { // GetMapData return all mapdata func (m *URLMap) GetMapData() []map[string]interface{} { - + m.lock.Lock() + defer m.lock.Unlock() + var resultLists []map[string]interface{} for k, v := range m.urlmap {