memory transport: use write mutex lock when close

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
Василий Толстов 2019-07-12 12:11:08 +03:00
parent 5157241c88
commit a72e1185da

View File

@ -84,8 +84,8 @@ func (ms *memorySocket) Send(m *transport.Message) error {
} }
func (ms *memorySocket) Close() error { func (ms *memorySocket) Close() error {
ms.RLock() ms.Lock()
defer ms.RUnlock() defer ms.Unlock()
select { select {
case <-ms.exit: case <-ms.exit:
return nil return nil