mirror of
https://github.com/livekit/livekit.git
synced 2026-03-30 19:55:41 +00:00
handle data race between updateState and OnStateChange (#727)
Signed-off-by: shishir gowda <shishir@livekit.io>
This commit is contained in:
@@ -431,6 +431,8 @@ func (p *ParticipantImpl) OnTrackPublished(callback func(types.LocalParticipant,
|
||||
}
|
||||
|
||||
func (p *ParticipantImpl) OnStateChange(callback func(p types.LocalParticipant, oldState livekit.ParticipantInfo_State)) {
|
||||
p.lock.Lock()
|
||||
defer p.lock.Unlock()
|
||||
p.onStateChange = callback
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user