1
Fork 0
mirror of https://github.com/jech/galene.git synced 2024-11-22 16:45:58 +01:00

Fix race in pushConn.

This commit is contained in:
Juliusz Chroboczek 2021-02-02 19:48:50 +01:00
parent 36d6845dc1
commit 73f72c45fc

View file

@ -469,12 +469,13 @@ func pushConnNow(up *rtpUpConnection, g *group.Group, cs []group.Client) {
// pushConn schedules a call to pushConnNow // pushConn schedules a call to pushConnNow
func pushConn(up *rtpUpConnection, g *group.Group, cs []group.Client) { func pushConn(up *rtpUpConnection, g *group.Group, cs []group.Client) {
up.mu.Lock()
if up.complete() { if up.complete() {
up.mu.Unlock()
pushConnNow(up, g, cs) pushConnNow(up, g, cs)
return return
} }
up.mu.Lock()
up.pushed = false up.pushed = false
up.mu.Unlock() up.mu.Unlock()