improved mutex error handling

- debug message in case of "unexpected" mutex errors
- removed experimental delay() in requestJSONBufferLock
This commit is contained in:
Frank
2025-12-23 00:33:28 +01:00
parent 1c2e6aac6e
commit c185f37791
3 changed files with 9 additions and 2 deletions

View File

@@ -480,6 +480,8 @@ void WLED::setup()
busDrawMux = xSemaphoreCreateRecursiveMutex(); // WLEDMM prevent concurrent running of strip.show and strip.service
segmentMux = xSemaphoreCreateRecursiveMutex(); // WLEDMM prevent segment changes while effects are running
jsonBufferLockMutex = xSemaphoreCreateRecursiveMutex(); // WLEDMM prevent concurrent JSON buffer writing
if ((busDrawMux == nullptr) || (segmentMux == nullptr) || (jsonBufferLockMutex == nullptr))
USER_PRINTLN(F("setup error: xSemaphoreCreateRecursiveMutex failed.")); // should never happen.
xSemaphoreGiveRecursive(busDrawMux); // init semaphores to initially allow drawing
xSemaphoreGiveRecursive(segmentMux);
xSemaphoreGiveRecursive(jsonBufferLockMutex);