1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2026-01-06 09:15:37 -05:00

fix a deadlock

This commit is contained in:
Darien Raymond
2018-05-31 13:12:36 +02:00
parent 4a46817cf6
commit ee0ca6cbd2

View File

@@ -328,6 +328,8 @@ func (w *udpWorker) Start() error {
Execute: func() error {
nowSec := time.Now().Unix()
w.Lock()
defer w.Unlock()
if len(w.activeConn) == 0 {
return nil
}
@@ -342,7 +344,6 @@ func (w *udpWorker) Start() error {
if len(w.activeConn) == 0 {
w.activeConn = make(map[connID]*udpConn, 16)
}
w.Unlock()
return nil
},