locker protected ReceivingQueue.Put

pull/215/head
v2ray 2016-06-30 16:58:38 +02:00
parent a1f5839461
commit 5680c69146
No known key found for this signature in database
GPG Key ID: 7251FFA14BB18169
1 changed files with 8 additions and 0 deletions

View File

@ -118,6 +118,14 @@ L:
}
func (this *ReceivingQueue) Put(payload *alloc.Buffer) {
this.RLock()
defer this.RUnlock()
if this.closed {
payload.Release()
return
}
this.queue <- payload
}