mirror of
https://github.com/torlando-tech/pyxis.git
synced 2026-05-24 16:15:18 +00:00
334f024179
- Move beginWriteOperation() before xSemaphoreGive(_conn_mutex) in write(), writeCharacteristic(), read(), and enableNotifications() so the active-op counter is incremented while the mutex is still held. This closes the window where processPendingDisconnects() could observe hasActiveWriteOperations()==false and delete the client before the GATT caller has registered its operation. - Add _conn_mutex around _connections/_clients insertions in both server and client onConnect() callbacks, preventing concurrent map insertions from corrupting the red-black tree. - Protect updateConnectionMTU() with _conn_mutex. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>