release read lock on AddSubscriber earlier

This commit is contained in:
David Zhao
2021-06-08 15:28:18 -07:00
parent d2cadac2b3
commit 7173dcc1d1
+1 -1
View File
@@ -421,7 +421,7 @@ func (p *ParticipantImpl) AddSubscriber(op types.Participant) (int, error) {
for _, t := range p.publishedTracks {
tracks = append(tracks, t)
}
defer p.lock.RUnlock()
p.lock.RUnlock()
if len(tracks) == 0 {
return 0, nil