Refactor mutex handling in PhoneAPI.cpp

Replace LockGuard with explicit lock and unlock calls to avoid deadlock
This commit is contained in:
Jonathan Bennett
2026-05-11 11:45:14 -05:00
committed by GitHub
parent 8e99ffbe7e
commit da61a0db7d

View File

@@ -545,8 +545,9 @@ size_t PhoneAPI::getFromRadio(uint8_t *buf)
prefetchNodeInfos();
} else {
LOG_DEBUG("Done sending %d of %d nodeinfos millis=%u", readIndex, nodeDB->getNumMeshNodes(), millis());
concurrency::LockGuard guard(&nodeInfoMutex);
nodeInfoMutex.lock();
nodeInfoQueue.clear();
nodeInfoMutex.unlock();
// Replay states no-op for legacy clients / excluded DBs.
state = STATE_REPLAY_POSITIONS;
return getFromRadio(buf);