Henrik Boström b3dd1738e4 Fix race in RTCStatsCollector's cache.
`cached_certificates_by_transport_` is used on the network thread, but
can be cleared from the signaling thread. To fix the race where clear
happens at the same time as stats collecting, a mutex is added.

This mutex should very rarely be contended in practise since
ClearCachedStatsReport() typically only happen during renegotiation
(e.g. when someone joins/leaves) and getStats only happens once per
second or less (typically).

NOTRY=Everything passes except unrelated purple bot

Bug: webrtc:14510
Change-Id: Iaf539a5cc8c87184fa0a87b9c889a13b941a9ad1
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/277620
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38262}
2022-09-30 18:21:20 +00:00
..
2022-05-12 18:34:33 +00:00
2022-09-27 15:05:51 +00:00
2022-09-27 15:05:51 +00:00
2022-01-18 13:46:37 +00:00