mirror of
https://github.com/go-micro/go-micro.git
synced 2024-12-24 10:07:04 +02:00
memory transport: use write mutex lock when close
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
parent
5157241c88
commit
a72e1185da
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user