Taksh ab0e97977c Serialize access to the per-peer actor map
This class exists to give each peer one actor so that peer's packets are
processed sequentially — the comment says it prevents a session-management
race. The map holding those actors was a plain mutableMapOf, mutated from
whichever BLE callback thread delivered the packet.

So the guarantee did not hold. Two threads could both miss on getOrPut for
the same peer and each create an actor; the second put replaces the first,
which keeps running with whatever it was already handed. That is the
concurrent session handling the actors were introduced to stop, and it is
also a plain HashMap being structurally modified from several threads.

Also drops peerActors, declared next to it and referenced nowhere.
2026-10-05 16:16:07 +05:30
..
2025-12-14 21:55:41 +07:00
2026-07-29 03:41:16 +02:00