Amazon Kinesis Video Streams Webrtc SDK is for developers to install and customize realtime communication between devices and enable secure streaming of video, audio to Kinesis Video Streams.
Corrected thread synchronization to prevent unsafe access to shared variables across threads.
Added missing resetting of pConnectionListener->receiveDataRoutine to INVALID_TID_VALUE.
Fixed RollingBufferlastIndex race.
Note: This one only appeared as a T-San warning when I ran the sample myself and connected/disconnected viewer several times - issue did not show when I ran the test suite.
Why was it changed?
In order to resolve Thread Sanitizer failures.
The failures are intermittent on the CI tests - re-running several times will eventually yield passing results.
The failures are consistently present when running locally on macOS with LLDB.
How was it changed?
Added missing mutex locks around asynchronous accessing of variables.
Set the receiveDataRoutine to INVALID_TID_VALUE whenever THREAD_JOIN is called on its thread. This was done for the IS_VALID_TID_VALUE check to actually be able to check for whether THREAD_JOIN was already called on the thread.
Wrapped access to pRollingBuffer->lastIndex within the pRollingBuffer->lock.
What testing was done for the changes?
Ran the test suite locally on Mac with T-San enabled in Debug mode.
Let the CI to pass 3 times in a row to check for intermittent issues.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
Issue #, if available:
What was changed?
pConnectionListener->receiveDataRoutine
toINVALID_TID_VALUE
.RollingBuffer
lastIndex
race.Why was it changed?
How was it changed?
receiveDataRoutine
toINVALID_TID_VALUE
wheneverTHREAD_JOIN
is called on its thread. This was done for theIS_VALID_TID_VALUE
check to actually be able to check for whetherTHREAD_JOIN
was already called on the thread.pRollingBuffer->lastIndex
within thepRollingBuffer->lock
.What testing was done for the changes?
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.