fix: use Lock
This commit is contained in:
parent
1ecbda1a54
commit
7173abb54f
|
@ -130,7 +130,7 @@ func (p *WebSocketPeer) EndForAbuse() error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
func (p *WebSocketPeer) SetId(id *encoding.NodeId) {
|
func (p *WebSocketPeer) SetId(id *encoding.NodeId) {
|
||||||
p.BasePeer.lock.RLock()
|
p.BasePeer.lock.Lock()
|
||||||
defer p.BasePeer.lock.Unlock()
|
defer p.BasePeer.lock.Unlock()
|
||||||
p.id = id
|
p.id = id
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue