ipmi_handler: make sequence number to be atomic
IpmiHandler::sequence needs to be thread safe or atomic
otherwise thread sanitizer will complaint about it
Change-Id: Idde90599e85be5a64a328fbd420ecfa1a7f960cf
Signed-off-by: Anh Phan <anhphan@google.com>
diff --git a/src/ipmiblob/ipmi_handler.cpp b/src/ipmiblob/ipmi_handler.cpp
index 81a70ca..90d3510 100644
--- a/src/ipmiblob/ipmi_handler.cpp
+++ b/src/ipmiblob/ipmi_handler.cpp
@@ -92,7 +92,7 @@
ipmi_req request{};
request.addr = reinterpret_cast<unsigned char*>(&systemAddress);
request.addr_len = sizeof(systemAddress);
- request.msgid = sequence++;
+ request.msgid = sequence.fetch_add(1, std::memory_order_relaxed);
request.msg.data = reinterpret_cast<unsigned char*>(data.data());
request.msg.data_len = data.size();
request.msg.netfn = netfn;