1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-06-29 02:35:23 +00:00

Justify lock use

This commit is contained in:
Shelikhoo 2016-08-15 17:53:11 +08:00
parent 4853a1a6d3
commit 863237b518
No known key found for this signature in database
GPG Key ID: 7791BDB0709ABD21

View File

@ -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{}