瀏覽代碼

fixing deadlock

reid 2 年之前
父節點
當前提交
23da465934
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2 2
      auth/auth.go

+ 2 - 2
auth/auth.go

@@ -24,13 +24,13 @@ var (
 	// tokenid's can be referenced from the global conf
 	AuthenticatedClients = struct {
 		Conns map[*websocket.Conn]string
-		sync.Mutex
+		sync.RWMutex
 	}{
 		Conns: make(map[*websocket.Conn]string),
 	}
 	UnauthClients = struct {
 		Conns map[*websocket.Conn]string
-		sync.Mutex
+		sync.RWMutex
 	}{
 		Conns: make(map[*websocket.Conn]string),
 	}