The variable instance_count might be accessed from multiple threads when
different PeerConnectionFactory objects are used, which may create
multiple network threads. This is a pattern mostly noticed in tests.
This fixes issues with logging when run under TSAN, it should not have
any production impact.
Bug: chromium:1243702
Change-Id: Iab1412a7907545811a309cab27a3ae23b4718606
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/251983
Auto-Submit: Florent Castelli <orphis@webrtc.org>
Reviewed-by: Victor Boivie <boivie@google.com>
Commit-Queue: Florent Castelli <orphis@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36045}