Skip to content

Commit 6570314

Browse files
committed
PR comment - switched to RWmutex
1 parent 4f76b36 commit 6570314

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
@@ -139,7 +139,7 @@ type Server struct {
139139
sipUnhandled RequestHandler
140140
inviteTimeoutQueue utils.TimeoutQueue[dialogKey]
141141

142-
imu sync.Mutex
142+
imu sync.RWMutex
143143
inProgressInvites map[dialogKey]*inProgressInvite
144144

145145
closing core.Fuse

0 commit comments

Comments
 (0)