Explorar o código

Justify lock use

Shelikhoo %!s(int64=9) %!d(string=hai) anos
pai
achega
863237b518
Modificáronse 1 ficheiros con 8 adicións e 0 borrados
  1. 8 0
      transport/internet/ws/wsconn.go

+ 8 - 0
transport/internet/ws/wsconn.go

@@ -160,6 +160,14 @@ func (ws *wsconn) SetWriteDeadline(t time.Time) error {
 func (ws *wsconn) setup() {
 	ws.connClosing = false
 
+	/*
+		https://godoc.org/github.com/gorilla/websocket#Conn.NextReader
+		https://godoc.org/github.com/gorilla/websocket#Conn.NextWriter
+
+		Both Read and write access are exclusive.
+		And in both case it will need a lock.
+
+	*/
 	ws.rlock = &sync.Mutex{}
 	ws.wlock = &sync.Mutex{}