From da61a0db7d18e23e4c05832d8bd7598668b78def Mon Sep 17 00:00:00 2001 From: Jonathan Bennett Date: Mon, 11 May 2026 11:45:14 -0500 Subject: [PATCH] Refactor mutex handling in PhoneAPI.cpp Replace LockGuard with explicit lock and unlock calls to avoid deadlock --- src/mesh/PhoneAPI.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/mesh/PhoneAPI.cpp b/src/mesh/PhoneAPI.cpp index ffe413056..720743907 100644 --- a/src/mesh/PhoneAPI.cpp +++ b/src/mesh/PhoneAPI.cpp @@ -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);