summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--device/channels.go2
1 files changed, 2 insertions, 0 deletions
diff --git a/device/channels.go b/device/channels.go
index 8cd6aee..4bd6090 100644
--- a/device/channels.go
+++ b/device/channels.go
@@ -89,6 +89,7 @@ func newAutodrainingInboundQueue(device *Device) chan *QueueInboundElement {
if elem == nil {
continue
}
+ elem.Lock()
device.PutMessageBuffer(elem.buffer)
device.PutInboundElement(elem)
default:
@@ -118,6 +119,7 @@ func newAutodrainingOutboundQueue(device *Device) chan *QueueOutboundElement {
if elem == nil {
continue
}
+ elem.Lock()
device.PutMessageBuffer(elem.buffer)
device.PutOutboundElement(elem)
default: