diff --git a/pc/rtp_sender.cc b/pc/rtp_sender.cc index 6ef7f9f873..9eaed311a7 100644 --- a/pc/rtp_sender.cc +++ b/pc/rtp_sender.cc @@ -10,6 +10,7 @@ #include "pc/rtp_sender.h" +#include #include #include @@ -28,9 +29,11 @@ namespace webrtc { namespace { -// This function is only expected to be called on the signalling thread. +// This function is only expected to be called on the signaling thread. +// On the other hand, some test or even production setups may use +// several signaling threads. int GenerateUniqueId() { - static int g_unique_id = 0; + static std::atomic g_unique_id{0}; return ++g_unique_id; }