Fix 2 race conditions detected with TSan, one in CobraMetricsPublisher::push and another one in WebSocketTransport::sendData (that one was bad).

This commit is contained in:
Benjamin Sergeant committed 2019-09-24 11:46:54 -07:00
1 parent 490fbf4cb5
commit 94c589f696
8 files changed
+45 -3

No files matched your search

+2
View File
@@ -462,6 +462,8 @@ namespace ix
const Json::Value& msg,
bool addToQueue)
{
std::lock_guard<std::mutex> lock(_prePublishMutex);
invokePublishTrackerCallback(true, false);
CobraConnection::MsgId msgId = _id;
+1
View File
@@ -181,6 +181,7 @@ namespace ix
Json::Value _pdu;
Json::FastWriter _jsonWriter;
mutable std::mutex _jsonWriterMutex;
std::mutex _prePublishMutex;
/// Traffic tracker callback
static TrafficTrackerCallback _trafficTrackerCallback;