Skip to content

Commit 73a4029

Browse files
committed
PR comment - switched to RWmutex
1 parent c47e899 commit 73a4029

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
@@ -144,7 +144,7 @@ type Server struct {
144144
sipUnhandled RequestHandler
145145
inviteTimeoutQueue utils.TimeoutQueue[dialogKey]
146146

147-
imu sync.Mutex
147+
imu sync.RWMutex
148148
inProgressInvites map[dialogKey]*inProgressInvite
149149

150150
closing core.Fuse

0 commit comments

Comments
 (0)