livoxProto1:Device: Spinlock guard heartbeat stop() for races

This commit is contained in:
2025-11-07 21:36:00 -04:00
parent 7b092956c0
commit 1afa085fd4
2 changed files with 19 additions and 8 deletions
+2
View File
@@ -17,6 +17,7 @@
#include <boost/asio/posix/stream_descriptor.hpp>
#include "protocol.h"
#include <callback.h>
#include <spinLock.h>
// Custom hash function for std::pair<uint8_t, uint8_t>
namespace std {
@@ -162,6 +163,7 @@ public:
// Heartbeat state
std::unique_ptr<boost::asio::deadline_timer> heartbeatTimer;
std::atomic<bool> heartbeatActive;
smo::SpinLock heartbeatActiveLock;
// Point cloud data state
std::atomic<bool> pcloudDataActive;