From a2869ebf8502809179c7444921efd3328d2ead8a Mon Sep 17 00:00:00 2001 From: nxshock Date: Wed, 7 Aug 2019 19:33:10 +0500 Subject: [PATCH] Switch mutex RLock to Lock for RW method --- internal/backends/memory/backend.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/backends/memory/backend.go b/internal/backends/memory/backend.go index 28d5c53..38dc4cc 100644 --- a/internal/backends/memory/backend.go +++ b/internal/backends/memory/backend.go @@ -191,8 +191,8 @@ func (backend *Backend) GetEventByID(id string) rooms.Event { } func (backend *Backend) PutEvent(event rooms.Event) error { - backend.mutex.RLock() - defer backend.mutex.RUnlock() + backend.mutex.Lock() + defer backend.mutex.Unlock() backend.events[event.EventID] = event