threadsafe fixes

This commit is contained in:
2026-08-05 19:48:01 +03:00
parent 3f293ebd65
commit 1ddec15b87
2 changed files with 5 additions and 2 deletions
+4 -1
View File
@@ -623,7 +623,10 @@ bool PIPeer::dataRead(const uchar * readed, ssize_t size) {
return true;
}
cnt++;
if (cnt > _PIPEER_MSG_TTL || from == dp->name) return true;
if (cnt > _PIPEER_MSG_TTL || from == dp->name) {
eth_mutex.unlock();
return true;
}
sba << type << from << to << cnt << pba;
// piCout << "translate packet" << from << "->" << to << ", ttl =" << cnt;
sendToNeighbour(dp, sba);
+1 -1
View File
@@ -60,7 +60,7 @@ STATIC_INITIALIZER_END
PRIVATE_DEFINITION_START(PIMQTT::Client)
MQTTClient client = nullptr;
bool connected = false;
std::atomic<bool> connected{false};
PIProtectedVariable<EndpointsStorage> endpoints;