1
0
mirror of https://github.com/go-micro/go-micro.git synced 2025-06-30 22:33:49 +02:00

Merge pull request #582 from unistack-org/memory2

memory transport: use write mutex lock when close
This commit is contained in:
Asim Aslam
2019-07-12 10:29:46 +01:00
committed by GitHub

View File

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