Merge pull request #582 from unistack-org/memory2
memory transport: use write mutex lock when close
This commit is contained in:
commit
3ccb900bca
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user