Skip to content

Commit 0a64aef

Browse files
committed
PR comment - switched to RWmutex
1 parent fafb175 commit 0a64aef

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

pkg/sip/inbound.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,9 +162,9 @@ func (s *Server) getInvite(sipCallID, toTag, fromTag string) *inProgressInvite {
162162
fromTag: fromTag,
163163
}
164164

165-
s.imu.Lock()
165+
s.imu.RLock()
166166
is, exists := s.inProgressInvites[key]
167-
s.imu.Unlock()
167+
s.imu.RUnlock()
168168
if !exists {
169169
s.imu.Lock()
170170
is, exists = s.inProgressInvites[key]

pkg/sip/server.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ type Server struct {
143143
sipUnhandled RequestHandler
144144
inviteTimeoutQueue utils.TimeoutQueue[dialogKey]
145145

146-
imu sync.Mutex
146+
imu sync.RWMutex
147147
inProgressInvites map[dialogKey]*inProgressInvite
148148

149149
closing core.Fuse

0 commit comments

Comments
 (0)