Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
sfu
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alain Takoudjou
sfu
Commits
f8d2bb93
Commit
f8d2bb93
authored
Oct 27, 2020
by
Juliusz Chroboczek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Avoid deadlock in DelLocal.
parent
0c8df661
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
6 deletions
+9
-6
rtpconn/rtpconn.go
rtpconn/rtpconn.go
+9
-6
No files found.
rtpconn/rtpconn.go
View file @
f8d2bb93
...
...
@@ -211,30 +211,33 @@ func (up *rtpUpTrack) notifyLocal(add bool, track conn.DownTrack) {
func
(
up
*
rtpUpTrack
)
AddLocal
(
local
conn
.
DownTrack
)
error
{
up
.
mu
.
Lock
()
defer
up
.
mu
.
Unlock
()
for
_
,
t
:=
range
up
.
local
{
if
t
==
local
{
up
.
mu
.
Unlock
()
return
nil
}
}
up
.
local
=
append
(
up
.
local
,
local
)
up
.
mu
.
Unlock
()
up
.
notifyLocal
(
true
,
local
)
// do this asynchronously, to avoid deadlocks when multiple
// clients call this simultaneously.
go
up
.
notifyLocal
(
true
,
local
)
return
nil
}
func
(
up
*
rtpUpTrack
)
DelLocal
(
local
conn
.
DownTrack
)
bool
{
up
.
mu
.
Lock
()
defer
up
.
mu
.
Unlock
()
for
i
,
l
:=
range
up
.
local
{
if
l
==
local
{
up
.
local
=
append
(
up
.
local
[
:
i
],
up
.
local
[
i
+
1
:
]
...
)
up
.
mu
.
Unlock
()
up
.
notifyLocal
(
false
,
l
)
// do this asynchronously, to avoid deadlocking when
// multiple clients call this simultaneously.
go
up
.
notifyLocal
(
false
,
l
)
return
true
}
}
up
.
mu
.
Unlock
()
return
false
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment