Squashed commit of the following:
commit
e914576493bee03e7170506519b0f8662f760b90
Author: Michael Matirko <mmatirko@cisco.com>
Date: Wed Jun 17 12:02:31 2020 -0400
stream: lock xtradata stream_impl to avoid data race on logging
#include "stream.h"
#include <cassert>
+#include <mutex>
#include "detection/detection_engine.h"
#include "flow/flow_control.h"
};
static StreamImpl stream;
+static std::mutex stream_xtra_mutex;
//-------------------------------------------------------------------------
// session foo
void Stream::reg_xtra_data_log(LogExtraData f, void* config)
{
+ const std::lock_guard<std::mutex> xtra_lock(stream_xtra_mutex);
stream.extra_data_log = f;
stream.extra_data_config = config;
}